Using the command line in linux – part 2



This is part two in a series of “how to use the command line in linux” style articles…. these are intended to be quite basic for those that have not used a command line before…. In part one we logged in (if necessary) and found out about the help command, navigated a bit with the arrows and exit -ed from our login. This time we’ll try to learn a bit more about dealing with files and navigating. In a graphical interface, if you browse files, you’re presented with a list of files and folders for a directory that you can scroll through and read at your leisure. In the command line we have to tell the computer to list the files and folders for the directory that we’re currently “in” to list those in linux, we use the ls command….


When you log in under linux and open a command shell, you are usually put in your “home directory” (/home/username/)

$ls
10-23-05-username.xpm dead.letter Documents/ potatohead122804.tuberling music.raw tmp/
9-20-05-.xpm Desktop/ Download/ Music/ Pictures/ Video/

So…. let’s see, items with / after them are directories, everything else we see is a file.

how should we move to a folder to look? we need to “change directories” don’t we? cd is the command to use…

cd Documents (remember linux is case sensitive…) and press enter…
now ls
document.txt

there are some handy shortcuts too… to move “up” a directory type cd .. and we move “up” in the hierarchy (through nested folders) by one folder. We could also go directly to a folder by specifying it “explicitly” “cd /home/avery/Documents/web” for instance would take me to that folder no matter where I currently have the console open to.

If you get lost, you might type “pwd” to see the “present working directory”

Related Posts

Blog Traffic Exchange Related Posts
  • Using the command line in linux - part 4 Dealing with text.... we've looked at a couple of basics on logging in and starting to use the command line and hopefully not feeling too helpless there... we've seen ways to navigate directories and how to find new commands and how to find out more about how to use them.......
  • Evolution error "summary and folder mismatch even after a sync" In my wife's profile on the desktop she said she was getting an error message sending and receiving messages so.... when doing a send/receive of mail I saw evolution giving an error message of "summary and folder mismatch even after a sync". It seemed to download mail ok, it was......
  • "rm -f *" undelete I really ought to find a way to alias "rm -f *" to "rm -i" IF the time is between 1 AM and 7 AM.... Last night I was working late (2:30AM or so when this happened). I had just made a few "refinements" to some of my audio streaming......
Blog Traffic Exchange Related Websites
  • RSS ENTRY NOTIFICIATION: The Skinny On Credit Cards As some of you are aware, I am giving away a copy of The Skinny On Credit Cards: How to Master the Credit Card Game. As I said in the review: I think this is a great book for someone who is new to personal finance. If you consider yourself......
  • Suggestions On The Way To Complete Your Own Article Submission Article directories and lists are vital as a way to make sure that your submissions are being read and merchandise are obtained from the different websites you have. Article submission services are able to submit to the peak free directories as well as the smaller sites. This helps you save......
  • Creating A Custom 404 Error Page Every web surfer has encountered the dreaded 404 page not found error message. The generic error page is horrible to look at and it does not encourage web visitors to explore more of your site. Imagine being able to setup a custom error message page that looked good, told the......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site