Graphical user interfaces are super friendly to computer users. They were introduced in reaction to the perceived steep learning curve of command-line interfaces (CLIs).
However, they often require more resources, are less powerful and hard to automate via scripting.
As a computer expert, we want to be more efficient and do our jobs better. We know that command words may not be easily discoverable or mnemonic, so we try to list some common tasks that you might be tempted to do in GUI.
- copy a file
- duplicate a file
- copy a folder
- duplicate a folder
- move a file
- rename a file
- move a folder
- rename a folder
- merge folders
- create a new file
- create a new folder
- show file/folder size
- open a file with the default program
- zip a folder
- unzip a folder
- remove a file
- remove a folder
- list folder contents
- tree view a folder and its subfolders
- find a stale file
- show a calendar
- find a future date
- use a calculator
- force quit a program
- check server response
- view content of a file
- search for a text
- view an image
- show disk size
- check performance of your computer
- Quick tips
- Hotkeys
STOP DRAG AND DROPING A FILE, OR CMD/CTRL + C, CMD/CTRL + V A FILE π
Copy readme.txt
to the documents
folder
cp readme.txt documents/
STOP RIGHT CLICKING AND DUPLICATE A FILE π
cp readme.txt readme.bak.txt
STOP DRAG AND DROPING A FOLDER, OR CMD/CTRL + C, CMD/CTRL + V A FOLDER π
Copy myMusic
folder to the myMedia
folder
cp -a myMusic myMedia/
# or
cp -a myMusic/ myMedia/myMusic/
STOP RIGHT CLICKING AND DUPLICATE A FOLDER π
cp -a myMusic/ myMedia/
# or if `myMedia` folder doesn't exist
cp -a myMusic myMedia/
STOP DRAG AND DROPING A FILE, OR CMD/CTRL + X, CMD/CTRL + V A FILE π
mv readme.txt documents/
Always use a trailing slash when moving files, for this reason.
STOP RIGHT CLICKING AND RENAME A FILE π
mv readme.txt README.md
STOP DRAG AND DROPING A FOLDER, OR CMD/CTRL + X, CMD/CTRL + V A FOLDER π
mv myMedia myMusic/
# or
mv myMedia/ myMusic/myMedia
STOP RIGHT CLICKING AND RENAME A FOLDER π
mv myMedia/ myMusic/
STOP DRAG AND DROPING TO MERGE FOLDERS π
rsync -a /images/ /images2/
STOP RIGHT CLICKING AND CREATE A NEW FILE π
touch 'new file' # updates the file's access and modification timestamp if it already exists
# or
> 'new file' # erase the content if it already exists
STOP RIGHT CLICKING AND CREATE A NEW FOLDER π
mkdir 'untitled folder'
# or
mkdir -p 'path/may/not/exist/untitled folder'
STOP RIGHT CLICKING AND SHOW FILE/FOLDER INFO π
stat -x readme.md
# or
du -sh readme.md
STOP DOUBLE CLICKING ON A FILE π
xdg-open file # on Linux
open file # on MacOS
STOP RIGHT CLICKING AND COMPRESS FOLDER π
zip -r archive_name.zip folder_to_compress
STOP RIGHT CLICKING AND UNCOMPRESS FOLDER π
unzip archive_name.zip
STOP RIGHT CLICKING AND DELETE A FILE PERMANENTLY π
rm my_useless_file
IMPORTANT: The rm command deletes my_useless_file permanently, which is equivalent to move my_useless_file to Recycle Bin and hit Empty Recycle Bin.
STOP RIGHT CLICKING AND DELETE A FOLDER PERMANENTLY π
rm -r my_useless_folder
STOP OPENING YOUR FINDER OR FILE EXPLORER π
ls -la my_folder
STOP OPENING YOUR FINDER OR FILE EXPLORER π
tree # on Linux
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' # on MacOS
STOP USING YOUR FILE EXPLORER TO FIND A FILE π
Find all files modified more than 5 days ago
find my_folder -mtime +5
STOP LOOKING UP WHAT THIS MONTH LOOKS LIKE BY CALENDAR WIDGETS π
Display a text calendar
cal
Display selected month and year calendar
cal 11 2018
STOP USING WEBAPPS TO CALCULATE FUTURE DATES π
What is todays date?
date +%m/%d/%Y
What about a week from now?
date -d "+7 days" # on Linux
date -j -v+7d # on MacOS
STOP USING CALCULATOR WIDGET π
bc
STOP CTRL + ALT + DELETE and choose the program to kill π
killall program_name
STOP OPENING A BROWSER π
ping umair.surge.sh
STOP DOUBLE CLICKING A FILE π
cat apps/settings.py
STOP CMD/CTRL + F IN A FOLDER π
grep -ir "Query" file.txt
STOP USING PREVIEW π
imgcat image.png
STOP RIGHT CLICKING DISK ICON OR OPENING DISK UTILITY π
df -h
STOP OPENING YOUR ACTIVITY MONITOR OR TASK MANAGER π
top
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Letβs you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor
Alt + F Move cursor forward one word on the current line
Alt + B Move cursor backward one word on the current line
Tab Auto-complete files and folder names
Remember, you can always google or man
the commands you are not familiar with.