Locating files


You can use the local database to locate elements in the disk using the command locate, this database automatically updates but it can be manually updated with updatedb.

$ locate passwd
/usr/share/man/zh_CN/man1/gpasswd.1.gz
/usr/share/man/zh_CN/man1/passwd.1.gz
/usr/share/man/zh_CN/man5/gpasswd.5.gz
/usr/share/man/zh_CN/man8/chpasswd.8.gz
.
.
.

Change Directory (cd) command

The cd command is used to change the actual or work directory from where the next command will execute.

Change to home directory (from current user)

user@host:~/home_files/directory1/subdirectory$ cd ~
user@host:~$ 

Change to previous directory

user@host:~$ cd /home_files/directory1/subdirectory
user@host:~/home_files/directory1/subdirectory$ cd ~/home_files/directory2
user@host:~/home_files/directory2$ cd -
user@host:~/home_files/directory1/subdirectory$

Change to parent directory

user@host:~/home_files/directory1/subdirectory$ cd ..
user@host:~/home_files/directory1$

List command (ls)

The ls command is used to show the content of one or several directories.