Linux Tools - Terminal Commands
basic, command, linux, terminal
Screen
Screen is an app that
Screen is a tool that lets you manage multiple processes on one terminal. You can create multiple windows, each with its own program running inside, and switch between them. These windows run independently, so when detached, the terminal and the programs will keep running. Some useful screen commands are:
screen
: creates a new screen session.
screen -ls
: lists all running screen sessions.
screen -r -session name-
: reattaches to a detached screen session.
screen -d -session name-
: detaches from the current screen session.
screen -x -session name-
: if another terminal connection to the spesific screen is active, this command will reattach to a thescreen session and share screen with other logged in.
screen -S -session name-
: creates a screen with given name.
Ctrl + a
+ c
: creates a new window.
Ctrl + a
+ n
: switches to the next window.
Ctrl + a
+ p
: switches to the previous window.
Ctrl + a
+ d
: detaches from the current window.
Ctrl + a
+ [
: enters copy mode to scroll through the window's history.
Ctrl + a
+ ]
: pastes the copied text.
wget
wget
is a powerful and versatile command line tool for downloading files from the internet. It supports downloading files over HTTP, HTTPS, and FTP protocols, and can be used to recursively download entire websites.
It can:
- can download files in the background, allowing you to continue using the terminal for other tasks while the download is in progress.
- supports resuming interrupted downloads, so you can continue downloading a file from where it left off if the download was interrupted for any reason.
- can be used to download files over an encrypted connection using HTTPS, ensuring the security and privacy of your downloads.
- can be used to download multiple files or an entire directory with just one command, using its recursive download feature.
- can be used with a variety of options to customize the download process, such as setting bandwidth limits, retrying failed downloads, and specifying user agents.
Download a file in the background:
wget -b http://example.com/file.tar.gz
Resume an interrupted download:
wget -c http://example.com/file.tar.gz
Download a file over HTTPS:
wget https://example.com/file.tar.gz
Download an entire directory recursively:
wget -r -np https://example.com/directory/
Limit the download speed to 1 megabyte per second:
wget --limit-rate=1m http://example.com/file.tar.gz
Retry failed downloads 3 times:
wget --tries=3 http://example.com/file.tar.gz
Specify a custom user agent string:
wget --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" http://example.com/file.tar.gz
Pause a download and resume later:
wget -c http://example.com/file.tar.gz -O file.tar.gz.part
To resume:
wget -c http://example.com/file.tar.gz -O file.tar.gz.part
Stop a download:
Ctrl + C
Check the size of a file before downloading:
wget --spider --server-response http://example.com/file.tar.gz
Download a file to a specific location:
wget -O /path/to/save/file.tar.gz http://example.com/file.tar.gz
Convert links in downloaded HTML files to local links:
wget --convert-links -r -np http://example.com/