Some linux basics, not all. #1

With the ls command being one of the simplest commands to use, it lists files and folders/directories. Used alone it only displays visible files and folders. To display all files visible and not visible append -a to the ls command so that it looks like this.

user@ubuntu:$ ls -a

To see the directory in which you are issue the pwd command. This prints the current working directory. This command is really useful when you have no idea as to where you are in a file system. For example when you are logged unto remote server.

Changing the directory in which you are is very simple. The cd command changes the directory in which you are. cd alone takes you to the users home directory, (/home/user/). To change to another directory change directory use the cd command and the directory you wish to enter like this.

user@ubuntu:$ cd /etc

The directory is changed to the /etc directory.
Note : The trick about the cd command is that cd .. takes you back to the immediate parent directory.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: