📜 ⬆️ ⬇️

Some useful commands for working in terminal Linux

Downloading a file using a link with the ability to continue downloading, for example, when the connection is broken:
wget -c http://link/file 

View recording in a text file in real time:
 tailf file 

Find out the command execution time:
 time command 

Tracking changes in the output of the command:
 watch command 

The key combination to close the current session in bash and various utilities, for example, the MySQL client:
 Ctrl-D 

Quick file backup:
 cp file{,.copy} 

File cleanup:
 > file 

Cleaning a file if you do not have rights to the file:
 echo -n | sudo tee file 

or
 sudo truncate -s 0 file 

Keyboard shortcut for searching through the history of previously entered commands:
 Ctrl-R 

Copy file with progress output:
 pv sourcefile > destfile 

Search for running processes without displaying the search process itself:
 ps aux | grep [p]rocess 

Create a directory and all subdirectories if they are missing:
 mkdir -p /path/to/directory 

Displaying pop-up messages on Gnome and Debian-based systems:
 notify-send "message!" 

It works similar to the cat command, with the difference that zcat is intended for packed files.
 zcat file 

Recursive search for files containing the search string:
 grep -lr string /directory 

Displays a list of libraries required for the program:
 ldd file 

')

Source: https://habr.com/ru/post/325708/


All Articles