Navigating Linux File System

Linux is most probably the most used operating system when it comes to development. Learning how to navigate the Linux file system can really benefit if you plan on using linux as you primary operating system or for development purposes
Basic Commands
1. pwd: print the name of the current working directory on the terminal
Use this command to find out where you are in the directory structure. When you log on to Linux, your starting directory is always your home directory, so you will be in /home/[your username] as any other than root, or /root if you are logged in as root.
pwd
2) ls: list the contents of the current working directory
ls command is the most used ls command in Linux. It is the command that most people use once they are logged in a Linux system.
To see what files we have in the current working directory we can use the "ls" command
To see all the hidden files ( those starting with a period ), use the following switch:
ls -a
3) cd: change directory
To change our current working directory we use the "cd" command. To be able to change tho current working directory type "cd" followed by the pathname of the new directory to which you wand to go to.Linux uses two symbols to represent the current directory and and it's parent directory in the file system. These symbols are "." which refers to the working directory and ".." symbol which refers to the parent directory of the working directory.
cd /usr/bin
To change to the parent directory of the current directory you are in just use the below command
cd ..
the above command has the ".." that is to indicate the parent directory that you are currently working on.
Shortcut to home directory:
The symbol "~" represents the home directory of the user
this is how it is used
cd ~
or you can just use the "cd " command without the "~" symbol





Very helpful
ReplyDeletethanks
Delete