Skip to content

Instantly share code, notes, and snippets.

@RenegadeEagle
Last active March 28, 2021 07:30
Show Gist options
  • Save RenegadeEagle/accbd46af97226468c125f24aaab1d2e to your computer and use it in GitHub Desktop.
Save RenegadeEagle/accbd46af97226468c125f24aaab1d2e to your computer and use it in GitHub Desktop.
Linux Beginner Commands
Here is a list of the most common commands you will use.
Remember:
You can always hit the "up" key on the keyboard to use the last command.
Create an empty file from scratch:
command: touch <filename>
example: touch main.py
List all folders and files in the current directory you are in:
command: ls
example: ls
Edit a file using nano:
command: nano <filename>
example: nano config.yml
notes: Control + X to leave.
Change to a directory:
command: cd <path>
example: cd /root/some/folder
notes: You can do "cd .." to illustrate going up 1 folder level.
Delete a file or directory:
command: rm <filename>
example: rm config.yml
notes: To delete a folder and everything inside, you MUST pass the -rf switch onto the rm command.
example: rm -rf /some/foldername #Deletes the "foldername" folder.
Install a package: (Debian Only)
command: apt-get install <packagename>
example: apt-get install screen
Create a screen:
command: screen -S screename
example: screen -S minecraftserver
Connect to a screen:
command: screen -r screenname
example: screen -r minecraftserver
Exit a screen:
command: Type "Control + A + D" on your keyboard and it will exit the screen
Stop a process:
command Type "Control + C" on your keyboard
Print data of a file:
command: cat <filename>
example: cat config.yml
Get the IP of the machine you are running on:
command: curl icanhazip.com
Clear the entire screen:
command: clear
@matte-o
Copy link

matte-o commented Mar 28, 2021

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment