remove file path in terminal and just display a folder - file

So to get started with my work I usually have to cd into a specific folder in iterm2.
Sorta looks like this [johnson#david-MacBook-Pro /Applications/MAMP/htdocs/demoapp] 16:41:32 $
As you can see that takes up a ton of room in the damn window. How do I remove the name of the path and just have it so its like this
demoapp ->
I've seen this in video tutorials where the only thing on the screen is the name of the folder or directory the person is in without all the extra info.
Obviously this a Mac specific question. Is it possible to toggle between showing full path and just specific path for quick reference?
thanks!

When one uses a Terminal (in Linux or Mac) initiated as root, only the actual directory is shown. In my case (using Linux Mint), if I start a normal Terminal, and use the command su to login as root, the complete path changes to the actual directory.
Try this:
a) write su on the Terminal
b) enter...
c) it asks for the root password, write it and press enter again.

Related

Run with stdin in CLion

I would like to ask if there is any possibility to run code with custom parameters in CLion. And where to put the file.txt in project folder.
Something equivalent to ./program <file.txt
It seems as if redirection of stdin for the program to be run or debugged is still not implemented. See the issue "Add an option to specify default input and output streams for console applications" at JetBrain's bugtracker.
Other IDEs like Eclipse can do this.
In CLion, go to your Run/Debug Configurations. There's a field named Program arguments. This field allows you to set "a custom parameter":
You can find the corresponding documentation here.
An excerpt from the documentation to help finding the correct dialog:
With the Navigation bar visible (View | Appearance | Navigation Bar), the available run/debug configurations are displayed in the run/debug configuration selector in the Run area:
Note that this of course only works for executable targets (or non executable targets that have an executable set).
Also note that this will most likely not allow you to do any shell redirection. Setting the field to < myfile.txt will not have the effects you are looking for. It will literally copy the strings < and myfile.txt as input arguments 1 and 2 (0 being the binary name).
If you want to pass file contents in this manner you'll have to just pass the file path using this method and then open & load the file in your application.
This is now possible.
In the Run/Debug Configuration, you’ll find a new field called
Redirect input from. Enable it, and fill in the file path/name:
Source: https://blog.jetbrains.com/clion/2020/03/clion-2020-1-eap-input-redirection-config-macros/#input_redirection

How do I remove an Error.error file being created and cannot be deleted?

How do I delete/remove the "Error.error" file when the system says it is not there but it is?
The Error.error file was created somehow and I do not know why or how. However, the issue is the system has created this 0 byte file called "Error.error" and it cannot be deleted, even if I try a "permanent" delete command. It also will not allow me to delete any of the folder directory hierarchy in which is resides. When I do try create it, rename it, or create a physical file with the same name and extension, or try to delete this file directly or indirectly I receive the following error message:
"Could not find this item: This is no longer located in C:\maps\test. Verify the items location and try again." Then it list "Error.error" and its information. However, it is there visually.
Any thoughts or suggestions on how to remove or correct?
Thanks!
I had a very similar issue not too long ago where I had a file that was created by another program and whenever I tried to access or delete it, windows would give an error message like "...This is no longer located in...".
If you're having the same problem I was, here's how I got rid of the file. Start a command prompt. In the command prompt, enter a command like del "\\?\<full path to file>". So if your file name is "Error.error" and it is located in the folder "C:\maps\test", the command you would enter is
del "\\?\C:\maps\test\Error.error"
You can delete a folder that windows won't let you access in a similar way by changing the command from "del" to "rd /S".
If you don't know how to start a command prompt, simply click the start button and type "command". The start menu should offer an option named something like "Command Prompt - Desktop app". That's what you need to start.
I found a good explanation of what the "\\?\" means here.

DOSBOX In Ubuntu: Unable to open include file 'stdio.h' [duplicate]

Whenever I compile my program, I get the error above.
If you have problems like that, first of all your TC folder put in to the C:..drive.
after completing installation open turbo c blue screen.
there is a OPTIONS > Directories ..in that you can see for option to set up path..
include directories..you can set path there now.. C:\TC\INCUDE
libraries Directories..you can set path there...C:\TC\LIB
if you want to store your output in BIN then you can set..C:\TC\BIN..otherwise you can set another path where you want to store your output..
Finally you can give OK and finished processes..
It will now work properly
Do this: Open your turboc2 folder you have tc.exe file inside, beside this file you find another file as named as ' tcinst.exe ' open it.
You will see the installation menu:
select as-- > Option > Directory > Include directory
Here you have to change the path of the directory to the path where your INCLUDE folder is located. Same way change the path to library directory also over restart your tc.exe.
Check if you have anything like those stdio.h file and other header files under INCLUDE folder and LIB folder. LIB contains some files. In my case, I had the same issue but both of these folder were blank.. good to know.
Steps:
Press: ALT + O + D (i.e. press ATL (keep pressed) and then O english character) and then D).
You'll see a popup window.
This window will have values for INCLUDE and LIB directories. The by default value for these two boxes in the popup window are: Drive leter where you installed TC... i.e. C:\ or D:\ or whatever followed by the path for INCLUDE and LIB folder. So, in my case,
INCLUDE box was set to: "C:\TC\INCLUDE" and LIB directory value box was set to: "C:\TC\LIB" (without quotes).
Steps to resolve:
Press ALT + C.
Set your current directory as C:\TC\BGI
Press ALT + O + D, and put ../INCLUDE and ../LIB in Include/Lib directory values.
and now... when you'll run your progress, you'll say thanks to me. I like the archduchess C fractal graphics that I'm running on DOS Turbo C right now. Lol.
Go to OPTIONS tab then select directories option then enter the particular path where your turbo c folder exists.
Enter the path in all the four message boxes and it would start working like it did in my case. I have TurboC3 and all the files were together in one common root folder.
Check your environment include path. The file is not in the locations pointed by that environment variable.
Well, I've been working backshift just spent about 6 hours trying to figure this out.
All of the above information led to this conclusion along with a single line in dos prompt screen, when I exited the editor, go to the dos prompt my C: drive is mounted.
I did a dir search and what I found was: the way in which I had mounted the C drive initially looked like this
mount c: /
and my dir did not list all files on the C drive only files within the turboc++ folder.
From that I had drawn the conclusion that my directories should look like:
c:\include
not
c:\turboc++\tc\include
or
c:\tc\include
The real problem was the nature in which I had mounted the drive.
Hope this helps someone.
b.mac
Since you did not mention which version of Turbo C this method below will cover both v2 and v3.
Click on 'Options', 'Directories', enter the proper location for the Include and Lib directories.
On most systems, you'd have to be trying fairly hard not to find '<stdio.h>', to the point where the first reaction is "is <stdio.h> installed". So, I'd be looking to see if the file exists in a plausible location. If not, then your installation of Turbo C is broken; reinstall. If you can find it, then you will have to establish why the compiler is not searching for it in the right place - what are the compiler options you've specified and where is the compiler searching for its headers (and why isn't it searching where the header is).
Make sure the folder with the standard header files is in the projects path.
I don't know where this is in Turbo C, but I would think there's a way of doing this.
First check whether the folder name is right or wrong since while you copying to one folder from other accidently it takes other folder address eg it take C instead of F So from OPTION>DIRECTORY change the folder name
Just Re install the turbo C++ from your Computer and install again in the Directory C:\TC\ Folder.
Again The Problem exists ,then change the directory from FILE>>CHANGE DIRECTORY to C:\TC\BIN\

trouble with cake.bat

I am new to php and cake php. I am attempting to bake up some cakephp code in the Windows Command Prompt. When I do the command "cake bake" within C:\xampp\htdocs\cake\lib\Cake\Console, I get no result, just a blinking cursor. Has anyone else ever had this happen or have any suggestions that might be helpful?
Go to the dir C:\xampp\htdocs\cake\app.
I don't know which version of Windows you have. However, you must access Environment Variables Access it by any mean.
In Windows7:
Right Click on Mycomputer-> Properties -> click on Advanced System Settings -> The last button Environment Variables is there, click on it From System Variables list select Path and then press Edit button. You will see a line of code, at its end add something like the following:
;C:\xampp\htdocs\cakephp\cake\console\;C:\xampp\php
The first path is the path in-which cake.bat file is found
The second path is the path in-which php.exe is found.
Restart your coputer and you will find cake bake works fine at any directory you want.

How to fix "unable to open stdio.h in Turbo C" error?

Whenever I compile my program, I get the error above.
If you have problems like that, first of all your TC folder put in to the C:..drive.
after completing installation open turbo c blue screen.
there is a OPTIONS > Directories ..in that you can see for option to set up path..
include directories..you can set path there now.. C:\TC\INCUDE
libraries Directories..you can set path there...C:\TC\LIB
if you want to store your output in BIN then you can set..C:\TC\BIN..otherwise you can set another path where you want to store your output..
Finally you can give OK and finished processes..
It will now work properly
Do this: Open your turboc2 folder you have tc.exe file inside, beside this file you find another file as named as ' tcinst.exe ' open it.
You will see the installation menu:
select as-- > Option > Directory > Include directory
Here you have to change the path of the directory to the path where your INCLUDE folder is located. Same way change the path to library directory also over restart your tc.exe.
Check if you have anything like those stdio.h file and other header files under INCLUDE folder and LIB folder. LIB contains some files. In my case, I had the same issue but both of these folder were blank.. good to know.
Steps:
Press: ALT + O + D (i.e. press ATL (keep pressed) and then O english character) and then D).
You'll see a popup window.
This window will have values for INCLUDE and LIB directories. The by default value for these two boxes in the popup window are: Drive leter where you installed TC... i.e. C:\ or D:\ or whatever followed by the path for INCLUDE and LIB folder. So, in my case,
INCLUDE box was set to: "C:\TC\INCLUDE" and LIB directory value box was set to: "C:\TC\LIB" (without quotes).
Steps to resolve:
Press ALT + C.
Set your current directory as C:\TC\BGI
Press ALT + O + D, and put ../INCLUDE and ../LIB in Include/Lib directory values.
and now... when you'll run your progress, you'll say thanks to me. I like the archduchess C fractal graphics that I'm running on DOS Turbo C right now. Lol.
Go to OPTIONS tab then select directories option then enter the particular path where your turbo c folder exists.
Enter the path in all the four message boxes and it would start working like it did in my case. I have TurboC3 and all the files were together in one common root folder.
Check your environment include path. The file is not in the locations pointed by that environment variable.
Well, I've been working backshift just spent about 6 hours trying to figure this out.
All of the above information led to this conclusion along with a single line in dos prompt screen, when I exited the editor, go to the dos prompt my C: drive is mounted.
I did a dir search and what I found was: the way in which I had mounted the C drive initially looked like this
mount c: /
and my dir did not list all files on the C drive only files within the turboc++ folder.
From that I had drawn the conclusion that my directories should look like:
c:\include
not
c:\turboc++\tc\include
or
c:\tc\include
The real problem was the nature in which I had mounted the drive.
Hope this helps someone.
b.mac
Since you did not mention which version of Turbo C this method below will cover both v2 and v3.
Click on 'Options', 'Directories', enter the proper location for the Include and Lib directories.
On most systems, you'd have to be trying fairly hard not to find '<stdio.h>', to the point where the first reaction is "is <stdio.h> installed". So, I'd be looking to see if the file exists in a plausible location. If not, then your installation of Turbo C is broken; reinstall. If you can find it, then you will have to establish why the compiler is not searching for it in the right place - what are the compiler options you've specified and where is the compiler searching for its headers (and why isn't it searching where the header is).
Make sure the folder with the standard header files is in the projects path.
I don't know where this is in Turbo C, but I would think there's a way of doing this.
First check whether the folder name is right or wrong since while you copying to one folder from other accidently it takes other folder address eg it take C instead of F So from OPTION>DIRECTORY change the folder name
Just Re install the turbo C++ from your Computer and install again in the Directory C:\TC\ Folder.
Again The Problem exists ,then change the directory from FILE>>CHANGE DIRECTORY to C:\TC\BIN\

Resources