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
  • 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......
  • A Tip for cleaning up an infected PC There's a joke that many people bring out when new Windows viruses hit big.... it goes along the lines of, "download a fix here" and the link points to a knoppix linux livecd download, or a Mandriva download disk, fedora/etc... Some say linux isn't affected by as many viruses because......
  • Recovering a Split BiggieFile from a MondoRescue Backup Once upon a time I wrote of manually extracting a file from a mondorescue backup. Sometimes it's just easier to do that, than have mondorescue go through 30 some cds or dvds just to find one file. (Not to mention the fact that the iso's aren't burned to disc but......
Blog Traffic Exchange Related Websites
  • Convert Prosper XML to CSV Many, Many people have asked me if there was an easy way to get the Prosper XML files as CSV (comma separated values).  In response, I have build a utility that does just that.  I contributed the utility to the Prosper API Open Source Project on SourceForge. With CSV files......
  • Turn Any File into an EXE with Convert to EXE If you're a geek like me, you may on occasion have run into a situation where you had a file that you needed to convert to exe. I had read a few forum posts and tutorials on how to do this with self-extracting installers, and I even managed to do......
  • Solidifying WP Security Designed with PHP, and powered by mySQL directories, WordPress is used by an amazing 8.5% of all websites. Web delivered spyware and web page hacking are becoming progressively more common. With such a lot of web content using WordPress as a CMS, any security weaknesses in the CMS structure or......
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