Useful Linux Commands
Show what devices are connected to local network:
$ nmap -sP 10.0.0.ip/24
Download all PDFs from a webpage:
$ wget --user=username --ask-password -r -l1 -H -t1 -nd -N -np -A.pdf -erobots=off http://path.to.page/
Reload .bashrc
without logging back in:
$ . ~/.bashrc
Set github remote to use SSH
instead of HTTPS
:
$ git remote set-url origin git@github.com:username/your-repository.git
Print file from command line:
$ lp /path/to/file
Display the file system disk space usage in human readable form:
$ df -h
Make an audio recording:
$ arecord /path/to/filename.wav
Switch back to last working directory
$ cd -
Unfreeze your Linux terminal from accidental Ctrl+S
Ctrl+Q
Movement
Move to beginning/bnd of terminal line
Ctrl+A / Ctrl+E
Open a new terminal tab
Shift + Ctrl + T
View file in terminal cd -
$ less <filename>
Reverse Search
Ctrl+R
List all commands available in current session
compgen -c
Close current window
Ctrl+Q
or the classic Alt+F4
Remove prefix from all files in working directory
for file in pref_*; do mv "$file" "${file#pref_}";done;
Thanks for Reading! --- @avcourt
Questions? Join my Discord server => discord.gg/5PfXqqr
Follow me on Twitter! => @avcourt