
Linux (Mint 19.1 Cinnamon) Terminal Commands, Specifying a Repository, Downgrading Program Version
pwd - print working directory
cd - change directory
clear - clears the terminal
ls - list all of the sources in the current directory
ls -l - long list with more details
ls -r - list in reverse alphabetical order
ls -p - list file types
ls -s - list by file size
ls [argument] - lists all of the sources alphabetically in the specified directory without switching to it
l = ls
ls --help
nano - to edit/create a file
nano ./filename - opens the file with name filename
sudo - super user do - gives admin power for one command
sudo nano ./filename - you can now edit the file and save it
su - switch user
sudo su - switches to root account (Root user has control over everything)
su accountname - to switch to another account
apt-get - a program used for installing applications (advanced packaging tool)
apt-get install filename/appname
apt-get remove filename/appname
apt install programname
appname - opens an installed program
apt-cache search appname* - searches the repository for anything with name appname
apt-cache policy appname - shows what the installed program's version is and what version the repository has
apt policy programname
apt-get upgrade - upgrade any packages that have new versions in the repository
dpkg -i ./filepath - to install a program whose installer is already on the pc (debian package – install)
(also aptitude)
chown user:group - change ownership
chmod - change permissions of a file
rm filename.format - remove a single file
mkdir - make directory
touch [filename.fileformat] - creates files [nano also opens the file whereas this doesn't]
rm -rf mydir - removes a directory named mydir
cp [filepath + filename] [filepath + filename] - copy [filepath is not always needed esp if you're staying in the same dir/used to copy&rename]
mv [filename] [filepath] - move [like copy but it doesn't leave a copy where it started/can be used to rename files/folders]
find . -type f -name "*.php" - finds all files with that format in the current dir
-iname - will return .php files regardless of case [.php ; .PhP ...]
top - shows running programs
ps aux - shows all of the programs running at the time of the command [not real time]
pgrep [program name/command from top] - gives you the PID for every instance of that program [shows them in chronological order/which was opened after which]
kill -9 PID - to terminate a process [one instance of a program]
killall [command] - terminates all instances of the program
/ - root
~ - home/username
$ - signifies where you are
./ - to the current/specified directory/file
../ - one level up
../../ - two levels up
!! - run previous command
-R - recursive
* - for all
PID - Process ID
[right arrow] - put info from ternimal to a file (ex: ls [right arrow] filename.txt)
Ctrl + O = Save
Ctrl + X = Exit
Ctrl + C = Exit Processes Menu
apt-based:
sudo apt-get -t reponame install packagename
yum-based:
sudo yum --enablerepo=reponame install packagename
zypper-based:
sudo zypper install reponame:packagename
sudo apt install [package]=[version]