Cheat Sheet Linux¶
Alias¶
Open the bash config file
sudo nano ~/.bashrc
Add your alias to the end of the file, for example:
Restart your shell
List running services¶
Create command alias¶
Edit the shell config file
Add the alias to the end of the file. This example allows you to use just ls
to get a full ls -la
output.
Restart the shell
Rename a directory¶
To rename a directory in Linux, you can use the mv command with the current directory name and the new directory name.
Display all users¶
To display all the users who exist on the server and sort them by name, you can use the "cat" command to read the "/etc/passwd" file and then pipe the output to the "cut" and "sort" commands.
List file including hidden¶
Check status of Apache¶
Show the OS release¶
apt-get error: repository suite error¶
error when using apt-get update; the suite has changed to
oldstable
and needs to be accepted before you can use it
Reading package lists... Done
E: Repository 'http://archive.raspberrypi.org/debian buster InRelease' changed its 'Suite' value from 'testing' to 'oldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
To accept the change to the suite value run the following command