1 / 4

Linux Basci commands

For more details please visit<br>https://www.emexotechnologies.com/

regus
Download Presentation

Linux Basci commands

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1.  Unix/Linux Command Reference File Commands 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. head file 11. tail file 12. tail -f file ls ls -al ls -lt cd dir cd pwd mkdir dir cat >file more file Directory listing Formatted listing with hidden files Sorting the Formatted listing by time modification Change directory to dir Change to home directory Show current working directory Creating a directory dir Places the standard input into the file Output the contents of the file Output the first 10 lines of the file Output the last 10 lines of the file Output the contents of file as it grows,starting with the last 10 lines Create or update file Deleting the file Deleting the directory Force to remove the file Force to remove the directory dir Copy the contents of file1 to file2 Copy dir1 to dir2;create dir2 if not present Rename or move file1 to file2,if file2 is an existing directory Create symbolic link link to file 13. touch file 14. rm file 15. rm -r dir 16. rm -f file 17. rm -rf dir 18. cp file1 file2 19. cp -r dir1 dir2 20. mv file1 file2 21. ln -s file link Process management 1. ps 2. top To display the currently working processes Display all running process Unix/Linux Command Reference 

  2. 3. 4. 5. 6. kill pid killall proc pkill pattern bg Kill the process with given pid Kill all the process named proc Will kill all processes matching the pattern List stopped or background jobs,resume a stopped job in the background Brings the most recent job to foreground Brings job n to the foreground 7. 8. fg fg n 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) Searching 1. 2. 3. grep pattern file grep -r pattern dir command | grep pattern locate file Find all instances of file find . -name filename Search for pattern in file Search recursively for pattern in dir Search pattern in the output of a command 4. 5. Searches in the current directory (represented by a period) and below it, for files and directories with names starting with filename Searches for all the named processes , that matches with the pattern and, by default, returns their ID 6. pgrep pattern System Info 1. 2. 3. 4. 5. date cal uptime w whoami Show the current date and time Show this month's calender Show current uptime Display who is on line Who you are logged in as Unix/Linux Command Reference 

  3. 6. 7. 8. 9. 10. man command 11. df 12. du 13. free 14. whereis app 15. which app finger user uname -a cat /proc/cpuinfo cat proc/meminfo Display information about user Show kernel information Cpu information Memory information Show the manual for command Show the disk usage Show directory space usage Show memory and swap usage Show possible locations of app Show which applications will be run by default Compression 1. 2. 3. 4. 5. 6. 7. 8. tar cf file.tar file tar xf file.tar tar czf file.tar.gz files tar xzf file.tar.gz tar cjf file.tar.bz2 tar xjf file.tar.bz2 gzip file gzip -d file.gz Create tar named file.tar containing file Extract the files from file.tar Create a tar with Gzip compression Extract a tar using Gzip Create tar with Bzip2 compression Extract a tar using Bzip2 Compresses file and renames it to file.gz Decompresses file.gz back to file Network 1. 2. 3. 4. 5. 6. ping host whois domain dig domain dig -x host wget file wget -c file Ping host and output results Get whois information for domains Get DNS information for domain Reverse lookup host Download file Continue a stopped download Unix/Linux Command Reference 

  4. Shortcuts 1. 2. ctrl+c ctrl+z Halts the current command Stops the current command, resume with fg in the foreground or bg in the background Logout the current session, similar to exit Erases one word in the current line Erases the whole line Type to bring up a recent command Repeats the last command Logout the current session 3. 4. 5. 6. 7. 8. ctrl+d ctrl+w ctrl+u ctrl+r !! exit Unix/Linux Command Reference 

More Related