{{announcement.body}}
{{announcement.title}}

Increase Your Linux literacy

DZone 's Guide to

Increase Your Linux literacy

In this article, we present some tips and tricks to increase your Linux literacy with Shell shortcuts, Linux commands, and some additional projects.

· Open Source Zone ·
Free Resource

In one of my Discord servers, we have a channel called #the-more-you-know in which we share cool tips and tricks on all kinds of topics. Today, I decided that it should be cleaned up and summarized as an article, so here I go:


Shell Shortcuts

Ctrl + A/Ctrl + E - Move the cursor to the start/end of the line.

Ctrl + U - Delete all characters before the cursor (a great alternative to spamming backspace whenever you mistype your password).

Ctrl + R - Search through your command history.

Ctrl + Z - Suspend the current application and return to the terminal shell. It is useful when editing files with Vim. To resume an application, type fg.

ALT + . - Inserts the last argument from the previous command. The other way is to use the variable $_ in your command. Example: mkdir test && cd $_.

Escape + Enter in zsh will insert a new line instead of running a command.


Linux Commands:

pstree -T - Shows a nice and clean overview of processes running on your system.

mv /path/to/something/{initialFileName,fileNameToRenameTo} - Rename file without typing the same file path twice. This shell feature is called Pathname expansion and works with most of the shell commands in a similar manner.

curl -o outputFile.iso file:///home/username/largeFile.iso - In case you are copying large files and would like to see progress, you can use curl.

If you need to find open ports on some system — probably the best tool for that is nmap. If it is not available, you can try using nc (netcat). Here are a few examples that I use all the time:

Shell
 




x


 
1
nmap -p 1-65535 my.hostname.com     # Scan whole ports range
2
nmap -p 80,8080,443 my.hostname.com # Scan 80,8080,443 
3
nmap --top-ports 10 my.hostname.com # Scan top 10 portsnc -zvw3 my.hostname.com 587        # Check if port 587 is open
4
netstat -tlpn                       # List open local ports



Other:

Steam has this little annoying features that pops up a window with some games each time you start it. To disable it, go to Steam > Settings > Interface and uncheck “Notify me about additions or changes to my games, new releases, and upcoming releases.”

In case you are using i3wm or something similar and full screening windows all the time. In Firefox, open the about:config page and set browser.fullscreen.autohide to false. This will stop the top bar from popping in and out whenever you full screen your browser.

You can create the .ssh/config file in which you can define your own aliases for ssh and scp. So instead of typing, ssh user@dev1.something.com, you could do something like, ssh dev1. Example:

Plain Text

Cool Projects:

USBGuard - Protects your PC from BadUSB.

LanCache - LAN Party game caching made easy.

FreePIE - Programmable Input Emulator for Gaming, VR, Remote Control.

Gradle Native - Native software building support.

DNS over Wikipedia - Domains ending with .idk are redirected by searching Wikipedia and extracting the relevant URL from the infobox.

Topics:
bash, linux, shell, terminal, tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}