A Few Commands In Bash Shell

 In Basics Of Bash Shell, we have read about users and terminal. In this post, we will learn a few basic commands to explore a system details.

Terminal Again


Here we see a terminal window. This is on a Ubuntu system. Here we see a $ symbol in the starting. This is a prompt for a normal user. We have used command sudo su - to switch to the root user whose prompt starts with #. Now we can again switch to a normal user using exit command. And the prompt returns to $ again.
To run a command we type command against the prompt and hit Enter key. The prompt returns after the command execution and display of the result. At last, we can type exit and end the current session.

A Few Commands

We use ls command to list files and directories inside the current directory. pwd command is being used to know the path of the current directory. And, we can use a path after cd command to change the current directory e.g. cd /dir1/dir2 or cd ../dir1. We have learnt about an absolute path and a relative path in Bash Shell In Linux.
I'm afraid that ls command is not showing all files and directories inside the current directory. So, we can use -a option with ls command to display all hidden files and directories which names start with a .(dot) e.g. ls -a. 
If ls command is used with a path then files and directories inside that particular directory is displayed e.g. ls -a /dir1/dir2. We can also use -l option to show files and directories details e.g. ls -l.
Last but not least, we can use several options together e.g. ls -l -a /dir1/dir2 or ls -la /dir1/dir2.

Happy reading and thank you. Meet you soon.

Comments

Popular posts from this blog

Bash Shell In Linux

Creating An Animation Using A Text Editor

expr command In TCL