UNIX COMMANDS CHEAT SHEET Command Example ..., Study notes of History

UNIX COMMANDS CHEAT SHEET. Command. Example. Description. 1. ls ls ls -alF. Lists files in current directory. List in long format. 2. cd cd tempdir.

Typology: Study notes

2021/2022

Uploaded on 07/05/2022

carol_78
carol_78 ๐Ÿ‡ฆ๐Ÿ‡บ

4.8

(59)

1K documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
U N IX C O M M A N D S CHEAT SHEE T
Command
Example
Description
1. ls
ls
ls -alF
Lists files in current directory
List in long format
2. cd
cd tempdir
cd ..
cd ~dhyatt/web-docs
Change directory to tempdir
Move back one directory
Move into dhyatt's web-docs directory
3. mkdir
mkdir graphics
Make a directory called graphics
4. cp
cp file1 web-docs
cp file1 file1.bak
Copy file into directory
Make backup of file1
5. rm
rm file1.bak
Remove or delete file
6. mv
mv old.html new.html
Move or rename files
7. man
man ls
Online manual (help) about command
8. head
head file1
head -100 file1
Display the first 10 lines in a file
Display the first 100 lines in a file
9. tail
tail file1
tail โ€“f file1
Display the last 10 lines in a file
Display the contents of the file as it
grows, last 10 lines at a time.
10. less
more index.html
Look at file, one page at a time
11. more
less index.html
Look at file, one page at a time
12. cat
cat index.html
cat file1 file2
Print on the standard output
Concatenate files
13. grep <str><files>
grep "bad word" file1
Look for occurrence of a certain pattern
in a file
14. chmod <opt> <file>
chmod 644 *.html
chmod 755 file.exe
Change file permissions read only
Change file permissions to executable
15. ps <opt>
ps aux
ps aux | grep dhyatt
List all running processes by #ID
List process #ID's running by dhyatt
16. kill <opt> <ID>
kill -9 8453
Kill process with ID #8453
17. history
history
Lists commands you've done recently
18. top
top
Print system usage and top resource
hogs
19. pwd
pwd
Print name of current/working directory
20. gzip <file>
gzip bigfile
gunzip bigfile.gz
Compress file
Uncompress file
21. tar <file>
tar -cf subdir.tar subdir
tar -xvf subdir.tar
Create an archive called subdir.tar of a
directory
Extract files from an archive file
22. ln โ€“s <file> li nk
ln โ€“s file link
Create symbolic link, link to file
23. df
df โ€“h
Show disk space in human-readable
format
24. du
du
Show directory space usage
25. nohup <command>
nohup cp file1 file2
Run a command immune to hang-ups,
26. <command> &
nohup cp file1 file2 &
Run a command in the background
27. ssh <user@host>
Connect to host as user
28. wget <url/file>
wget http://seq.edu/file
Download file from valid url
29. scp
Secure copy a file from one host to
another
Collected from http://www.tjhsst.edu/~dhyatt/superap/unixcmd.html

Partial preview of the text

Download UNIX COMMANDS CHEAT SHEET Command Example ... and more Study notes History in PDF only on Docsity!

UNIX COMMANDS CHEAT SHEET

Command Example Description

  1. ls ls ls - alF Lists files in current directory List in long format
  2. cd cd tempdir cd .. cd ~dhyatt/web-docs Change directory to tempdir Move back one directory Move into dhyatt's web-docs directory
  3. mkdir mkdir graphics Make a directory called graphics
  4. cp cp file1 web-docs cp file1 file1.bak Copy file into directory Make backup of file
  5. rm rm file1.bak Remove or delete file
  6. mv mv old.html new.html Move or rename files
  7. man man ls Online manual (help) about command
  8. head head file head - 100 file Display the first 10 lines in a file Display the first 100 lines in a file
  9. tail tail file tail โ€“ f file Display the last 10 lines in a file Display the contents of the file as it grows, last 10 lines at a time.
  10. less more index.html Look at file, one page at a time
  11. more less index.html Look at file, one page at a time
  12. cat cat index.html cat file1 file Print on the standard output Concatenate files
  13. **grep ** grep "bad word" file1 Look for occurrence of a certain pattern in a file
  14. **chmod ** chmod 644 *.html chmod 755 file.exe Change file permissions read only Change file permissions to executable
  15. **ps ** ps aux ps aux | grep dhyatt List all running processes by #ID List process #ID's running by dhyatt
  16. **kill ** kill - 9 8453 Kill process with ID #
  17. history history Lists commands you've done recently
  18. top (^) top Print system usage and top resource hogs
  19. pwd (^) pwd Print name of current/working directory
  20. gzip ** gzip bigfile gunzip bigfile.gz Compress file Uncompress file 21. tar ** tar - cf subdir.tar subdir tar - xvf subdir.tar Create an archive called subdir.tar of a directory Extract files from an archive file
  21. ln โ€“ s link ln โ€“ s file link Create symbolic link, link to file
  22. df df โ€“ h Show disk space in human-readable format
  23. du du Show directory space usage 25**. nohup ** nohup cp file1 file2 Run a command immune to hang-ups,
  24. ** &** nohup cp file1 file2 & Run a command in the background
  25. ssh ** ssh [email protected] Connect to host as user 28. wget ** wget http://seq.edu/file Download file from valid url
  26. scp scp [email protected]:file [email protected]:file Secure copy a file from one host to another Collected from http://www.tjhsst.edu/~dhyatt/superap/unixcmd.html