You-Dont-Need-GUI/readme.md

168 lines
3.2 KiB
Markdown
Raw Normal View History

2016-09-17 18:54:40 +10:00
# You Don't Need GUI
<details>
It's for noobs :)
</details>
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).
![Xerox Star 8010 workstations](./Xerox_Star_8010_workstations.jpg)
2016-09-18 17:39:18 +10:00
However, they often require more resources, are less powerful and hard to automate via scripting.
2016-09-17 18:54:40 +10:00
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 tempt to do in GUI.
2016-09-18 10:42:02 +10:00
## Quick links
1. [copy a file](#copyfile)
1. [duplicate a file](#duplicatefile)
1. [copy a folder](#copyfolder)
2016-09-18 17:39:18 +10:00
1. [duplicate a folder](#duplicatefolder)
2016-09-18 10:42:02 +10:00
1. [move a file](#movefile)
1. [move a folder](#movefolder)
1. [new file](#newfile)
1. [new folder](#newfolder)
1. [file/folder size](#filesize)
1. [open a file with default program](#opendefault)
1. [zip a folder](#zipfolder)
2016-09-18 17:39:18 +10:00
1. [unzip](#unzip)
1. [remove a file](#removefile)
2016-09-18 10:42:02 +10:00
1. [remove a folder](#removefolder)
1. [list folder contents](#listfolder)
## <a id="copyfile"></a>copy a file
2016-09-17 18:54:40 +10:00
**STOP DRAG AND DROP A FILE, OR CMD/CTRL + C, CMD/CTRL + V A FILE**
Copy `readme.txt` to the `documents` folder
```
cp readme.txt documents
```
2016-09-18 10:42:02 +10:00
## <a id="duplicatefile"></a>duplicate a file
2016-09-17 20:22:03 +10:00
**STOP RIGHT CLICK AND DUPLICATE FILE**
If `readme.bak.txt` file doesn't exist
```
cp readme.txt readme.bak.txt
```
2016-09-18 10:42:02 +10:00
## <a id="copyfolder"></a>copy a folder
2016-09-17 18:54:40 +10:00
**STOP DRAG AND DROP A FOLDER, OR CMD/CTRL + C, CMD/CTRL + V A FOLDER**
Copy `myMusic` folder under `myMedia` folder
```
cp -R myMusic myMedia
```
2016-09-18 10:42:02 +10:00
## <a id="duplicatefolder"></a>duplicate a folder
2016-09-17 20:16:35 +10:00
**STOP RIGHT CLICK AND DUPLICATE FOLDER**
If `myMedia` folder doesn't exist
```
cp -R myMusic myMedia
```
2016-09-18 10:42:02 +10:00
## <a id="movefile"></a>move a file
2016-09-17 18:54:40 +10:00
**STOP DRAG AND DROP A FILE, OR CTRL + X, CTRL + V A FILE**
```
mv readme.txt documents
```
2016-09-18 10:42:02 +10:00
## <a id="movefolder"></a>move a folder
2016-09-17 18:54:40 +10:00
**STOP DRAG AND DROP A FOLDER, OR CTRL + X, CTRL + V A FOLDER**
```
mv myMedia myMusic
```
2016-09-18 10:42:02 +10:00
## <a id="newfile"></a>new file
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND CREATE A NEW FILE**
```
touch 'new file'
```
2016-09-18 10:42:02 +10:00
## <a id="newfolder"></a>new folder
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND CREATE A NEW FOLDER**
```
mkdir 'untitled folder'
```
or
```
mkdir -p 'path/may/not/exist/untitled folder'
```
2016-09-18 10:42:02 +10:00
## <a id="filesize"></a>file/folder size
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND SHOW FILE/FOLDER INFO**
```
stat -x readme.md
```
2016-09-18 10:42:02 +10:00
## <a id="opendefault"></a>open a file with default program
2016-09-17 18:54:40 +10:00
**STOP DOUBLE CLICKING A FILE**
```
open file
```
2016-09-18 10:42:02 +10:00
## <a id="zipfolder"></a>zip a folder
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND COMPRESS FOLDER**
```
zip -r archive_name.zip folder_to_compress
```
2016-09-18 10:42:02 +10:00
## <a id="unzip"></a>unzip
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND UNCOMPRESS FOLDER**
```
unzip archive_name.zip
```
2016-09-18 10:42:02 +10:00
## <a id="removefile"></a>remove a file
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND DELETE FILE OR DRAG IT TO RECYCLE**
```
rm my_useless_file
```
2016-09-18 10:42:02 +10:00
## <a id="removefolder"></a>remove a folder
2016-09-17 18:54:40 +10:00
**STOP RIGHT CLICK AND DELETE FOLDER OR DRAG IT TO RECYCLE**
```
rm -rf my_useless_folder
```
2016-09-18 10:42:02 +10:00
## <a id="listfolder"></a>list folder contents
2016-09-17 18:54:40 +10:00
**STOP OPENING YOUR FINDER OR FILE EXPLORER**
```
ls -la my_folder
```
Remember, you can always google or `man` the commands you are not familiar with.