Debian Commands Flashcards
Where can you view a list of user groups
/etc/group
How do you add a user to an admin group
sudo usermod -aG <GROUPNAME> <USER>
-a (append) is critical or will remove from other groups rather than just adding to a new</USER></GROUPNAME>
Find the current date
date
Find the current working directory
pwd
Current computer name
hostname
View directory contents Inc hidden files
ls -a
How do you sort results in reverse
sort -r
How do you output to a text file
(In to home directory for this example)
> ~/output.txt
How to output any potential errors only
(eg of command/script for error logging)
2> ~/output.txt
How you output to both screen and file
tee ~/output.txt
Output and add to existing file
> > ~/output.txt
Refer to entire contents of current directory
./*
File permissions order
User, Group, Others
How do you find a binary’s location, manual and source
whereis
How do you find a binary in the PATH variable
which