Ubuntu commands list for daily use

 Ubuntu commands list for daily use

list of ubuntu commands for daily use and interview questions

                 File Commands

1. ls - Directory listing
2. ls –al - Formatted listing with hidden files
3. ls -lt - Sorting the Formatted listing by time modification
4. cd dir - Change directory to dir
5. cd - Change to home directory
6. pwd - Show current working directory
7. mkdir dir - Creating a directory dir
8. tail file - Output the last 10 lines of the file
9. tail -f - file Output the contents of file as it grows,starting withthe last 10 lines
10. touch - file Create or update file
11 rm -rf - dir Force to remove the directory dir
12. cp file1 file2 - Copy the contents of file1 to file2
13. cp -r dir1 dir2 - Copy dir1 to dir2;create dir2 if not present
14. mv file1 file2 - Rename or move file1 to file2,if file2 is an existingdirectory


                        Process management


1. ps - To display the currently working processes
2. top - Display all running process Unix/Linux Command Reference
3. pkill - pattern Will kill all processes matching the pattern


                         File permission


1. chmod octal file Change the permission of file to octal,which can be found separately for
user,group,world by adding,
• 4-read(r)
• 2-write(w)
• 1-execute(x)
2. chown - change file owner and group
-h - no-dereference affect each symbolic link instead of any referencedfile
-R, - recursive operate on files and directories recursively


                           System Info


1. date - Show the current date and time
2. uptime - Show current uptime
3. w - Display who is on line
4. whoami - Who you are logged in as
5. df - Show the disk usage
6. du - Show directory space usage
7. free - Show memory and swap usage


                             Compression


1. tar xf file.tar - Extract the files from file.tar
2. tar xzf file.tar.gz - Extract a tar using Gzip
3. tar xjf file.tar.bz2 - Extract a tar using Bzip2


                                Network

1. ping - host Ping host and output results
2. wget - file Download file
3. ifconfig - ip address of the machine
Installation
1.apt-get update - updating the packages list from the repository
2. apt-cache search {package-name} - Search package name in the repository
3. apt-get install {package-name} - Installing the selected package