- Run a job in background on Linux
- tar
- gunzip
- Add extension to a file
- Find a file in linux
- Check IP to whitelist
- Outputs Geographical Information, regarding an ip_address
- Show the available space on the mounted filesystems
- Show the size of a file or a folder
- List the conents of a file in a numbered fashion
- Search Bash history
- Moves the cursor to the beginning of the line
- Moves the cursor to the end of the line
- Run previous ran command
- Find word in a file
- Get 1st N rows from a file
$ nohup command > my.log 2>&1 &
$ sudo du -h --max-depth=1 | sort -h
$ sudo du -h --max-depth=4 ./log | sort -h
-
Create a tar archive
$ tar -cvf <file_name.tar> <file1> <file2>
- -c - create
- -v - verbose
- -f - the filename of the tar archive
-
Extract tar archives
$ tar -xvf <file_name.tar>
- -x - extract
- -v - verbose
- -f - the filename of tar archive to extract
-
Create archives and compress with tar
$ tar -czvf <file_name.tar.gz> <file1> <file2>`
- -c - create
- -z - zip
- -v - verbose
- -f - the filename of the compressed file
-
Uncompress using tar
$ tar -xzvf <file_name.tar.gz>
- -xz - uncompress and extract
- -v - verbose
- -f - the filename of the compressed file
-
Compress a file with gzip
gzip <file_name>
-
Extract .gz file
gunzip <file_name.gz>
$ for f in *; do mv "$f" "$f.gz"; done
$ sudo find . -name <file_name>
$ curl ifconfig.me ; echo
For current system's ip address:
$ curl ipinfo.io
For any specific ip address:
$ curl ipinfo.io/<ip_address>
$ df -h
$ du -sh <file/folder_name>
$ nl <file_name>
Ctrl+r
Ctrl+a
Ctrl+e
$ !!
$ grep <wordYouWantToFind> <fileName.txt>
!head -5 file_name.csv