در این قسمت سعی من بر این هست که میانبرهایی رو در یونیکیس برای شما قرار بدهم که معمولا به خاطر استفاده نکردن زیاد ممکن هست یادتون بره، اما کاربرد اونها خیلی زیاد هست و اگر بدونیدشون خیلی جاها می تونه خیلی سریع کمکتون کنه:
میانبر ها در CLIctrl+a
— move cursor to beginning of linectrl+e
— move cursor to end of linectrl+u
— clear to beginning of linectrl+k
— clear to end of line
cp -r dir1 dir
- copy directory dir1 to dir2ln -s file link
— create a soft symbolic link to file - softln file link
— create a hard symbolic link to file - hardless file
— view file with page navigationhead file
— output the first 10 lines of filetail file
— output the last 10 lines of filetail -f file
— output the contents of file as it grows
shutdown
— shut down machinereboot
— restart machinedf
— show disk usagedu
— show directory space usage
grep pattern files
— search for pattern in filesgrep -r pattern dir
— search recursively for pattern in dirgrep -rn pattern dir
— search recursively for pattern in dir and show the line number foundgrep -r pattern dir --include='*.ext
— search recursively for pattern in dir and only search in files with .ext extensiongrep -E pattern files
— search for pattern using Extended regexp in filescommand | grep pattern
— search for pattern in the output of commandfind file*
— find all instances of file in real systemfind . -iname 'string*'
- find file case insensitive with a patternfind -L . -iname '*.js' -exec chmod 744 {} \;
- find js files and change mode to 644 within this directoryfind /var/log/ -iname '*.tmp' -delete
- find .tmp files within that directory and delete themlocate file
— find all instances of file using indexed database built from the updatedb command. Much faster than findsed -i 's/day/night/g' file
— find all occurrences of day in a file and replace them with night - s means substitude and g means global - sed also supports regular expressionssed -i -- 's/old/new/g' */**(.D)
find and replace old string with new string withing this folder and all its subfolder
ps
— display your currently active processestop
— display all running processeskill pid
— kill process id pidkill -9 pid
— force kill process id pid
scp [email protected]:file dir
— secure copy a file from remote server to the dir directory on your machinescp file [email protected]:dir
— secure copy a file from your machine to the dir directory on a remote serverscp -r [email protected]:dir dir
— secure copy the directory dir from remote server to the directory dir on your machinessh -p port [email protected]
— connect to host on port as userssh-copy-id [email protected]
— add your key to host for user to enable a keyed or passwordless loginping host
— ping host and output resultswhois domain
— get information for domaindig domain
— get DNS information for domaindig -x host
— reverse lookup hostlsof -i tcp:1337
— list all processes running on port 1337
tar cvzf file.tar.gz files
— create a tar with Gzip compressiontar cafxz file.tar.gz
— extract a tar using Gzip
chmod ugo file
— change permissions of file to ugo - u is the user's permissions, g is the group's permissions, and o is everyone else's permissions. The values of u, g, and o can be any number between 0 and 7.x = 1
w = 2
r = 4
u = user
g = group
o = other
مثال
u+rwx
g=r
0-rwx
777
=a+rwx