Terminal - No such file or directory exists - terminal

So complete newbie question, but I've googled it and tried all their suggestions and I can't get it to work still :(
Trying to learn about the terminal... so I've created two files on my Desktop - filea.txt, fileb.txt - when I try to run the cd command I get the error, "No such file or directory exists".
I'm in the Desktop so that isn't the problem.
Is there anyone who could please suggest anything I can try?
I appreciate the help, and am completely grateful to anyone who answers - I understand time is valuable.
Thank you!

On an ubuntu to change to Desktop, you should type cd ~/Desktop, now you are in the Desktop directory, now typing ls would should list your files and directories on your desktop. Now you can open your file on a text editing application such as gedit by typing gedit filea.txt, which would open the file filea.txt in the text editor.

If you're trying to change directory to desktop and it's giving you that error, try typing cd .. which goes back one directory, and repeat to go back as far as you can and then try changing directory to desktop again.

Related

PATH related issues

A couple of days ago, I added code to my Mac's PATH to make some newly installed programs work properly on my machine. Unfortunately, it seems I have messed it up somewhere because some additional lines are printed every time I open my terminal.
Here is a screenshot of my terminal:
And here is a screenshot of my PATH Variable:
Does anyone know how I can remove extra lines in my terminal?
Thanks in advance
I renamed my ~/.zshrc file to ~/.zshrc2. Then all the extra lines were not shown anymore while opening up my terminal. Now I am sure the problems belong somewhere in my ~/.zshrc file
You can rename a folder by entering this command mv old-name-folder new-name-folder in the folder's directory.

How to navigate through local folders in command promt

I am a rookie who just started coding in python. I need to run the python files through cmd. Once I direct to a specific folder, I don't know the command line to direct me back to the root folder. Please do help in the earliest
"cd directory" will lead you to a folder
"cd .." will bring you back one folder up

How do you go to a local directory in PuTTy?

I'm not used to using PuTTy so I'm not very well versed with all the know hows to use it. So after I log onto the HostName/IP address and log in with my username and ID, there's a local directory /u/SysLab/ where one of the file belongs to me and that's where I'm supposed to do my coding, but I'm not sure how to access it, can anyone tell me how to do this? Me googling "How to go to local directory" yields questions that ask how to transfer files to the server, which isn't what I want to do. I just want to go into the directory and start my coding homework. Can anyone help me?
Did you try cd /u/SysLab?
That should change your current directory to /u/SysLab/ after that you should be able to open the file that you want to work on using some editor e.g. if use Emacs then you could do emacs -nw <yourfile>.
I strongly recommend to first get familiar with (at least) some basic navigation and file handling/editing in the terminal before starting to code.
Assuming your OS is Linux/Unix based, cd (change directory) and the path should work for you: cd /u/SysLab

File disappeared after trying to move it in terminal

Can anyone tell me where my file may have gone after this command?
The file I'm missing is stats.cpp
And what is the correct command to move it from directory prog3a to prog3c?
Thank you.
Since you did not post the actual command you used I cannot tell you what happened to the file. What I can say is that unless you used the rm command, the file is not gone. Probably got its name changed if you cannot find it or it got moved somewhere else other than the intended destination.
The correct command you should use is
mv prog3a/stats.cpp prog3c/stats.cpp
This command should be run in the directory where both prog3a and prog3c folders exist (cd to it before running the command. This is assuming they're both inside the same directory).
A more specific answer can be provided if you tell us which command you initially ran specifically and the full paths of each folder.

Unable to unlock file for editing in Xcode 4?

For some reason 2 of my files got locked and when I click the little lock icon in the upper right corner of the window it asks me if I would like to unlock, and doing so results in a "The file xxxx.h could not be unlocked" (Unlocking failed for an unknown reason). I have tried to restart Xcode, also tried to restart my machine with no help.
I am also unable to edit the files using BBEdit, I get the error "You do not have sufficient privileges to perform this operation (MacOS Error code: -5000)".
I'm running OS X Lion with Xcode 4.
Very strange as I have not made any changes to my system prior to this problem. Any help would be appreciated.
Open the file in any text editor. If the contents isn't text based you'll see a lot of gibberish. Ignore this, copy the contents. Open up a new text file. Paste the contents and save over the old file. This will copy just the contents of the file and ignore permissions.
What you're dealing with here is an ACL issue. If you ls -l the directory you'll see a little + on the end of the permission string:
drwxr-xr-x+ 4 eekyou staff 136 May 6 2011 eekyou.xcuserdatad
You can easily strip these off like so (in your project directory:
sudo chmod -R -E ./*
Hope this helps.
=]
The #eecue answer didn't help me. I user another Terminal command for complete removal of all ACL permissions:
sudo chmod -RN ./*
First check if the file is opened/locked by another program or user.
If it is not, the program probably crashed and failed to remove the flag, lookup the file and check with CMD+i if it is locked.
If it is not, permissions are probably wrong, so check the permission in the CMD+i dialog at the bottom, and apply them to everything in the enclosing folder (a .xcproject is a directory).
If this still doesn't work (like for me), there is a simple command line to unlock all files in a folder. ONLY do this if all the above steps have been checked / taken.
sudo chflags -R nouchg /Users/username/Development/GIT/MyProject
Replacing the project folder with your own project folder of course.
You may need to take ownership of the folder in which you wish to save your project. To do so, open up the console. Then type sudo chown $USER /path/to/your/project.

Resources