Moving around

Bunch of assorted commands

ls  #list  
ls -a  #all files       
.file    #anything you type with a dot will be a hidden file
ls /    root

pwd    #print working directory

cd     #change directory
cd /   #gives you root
cd ~  #returns you to home folder
cd   #without any other argument still returns you to home folder

cd ..     #moves up  a directory!
cd .. ..  #moves up two directories 

touch    #create new empty files


file    #find out what kind of file
cat    #concatenate - show two or more files content
less   #show content of file, less is more!
history  #show CLI command history

clear    clear terminal
Windows : cls 

cp  #copy  cp mycoolfile /home/pete/Documents/cooldocs  
mv   #move   mv oldfile newfile    (file1  DirectoryX)   mv file1 DirectoryX/   remember to add forward slash    mv file1 file2 file3 files/ 


fdisk -l  #view partitions in system 

Device files in the /dev directory is that the first position contains either c or b

crw--w----  1 root     tty         4,  22 2月  23 12:25 tty22

brw-rw----  1 root     disk        7,   1 2月  23 12:25 loop1

The c stands for character, external devices such as mice or keyboards, are character devices.

The b stands for the second type: block devices like hard drives and DVD drives

The Linux command lsblk , short for list block, lists some basic information about each block device listed in /dev.




help  #help + argument  >>> help netstat

man  #manual page >>> man netstat     or   man ls

whatis    #show what a command does  >>>  whatis  cat 

Alias  alias a command  alias foobar='ls -la'   to remove just type  unalias foobar
 
exit  logout    #to leave a current session


ls -la /etc        ls -la/etc | less      #show content of files

env  #shows environment         
echo $HOME  #gives HOME/nameofuser     
echo$USER   #gives  /nameofuser  
(env provides both info in one command)

set | more     #shows even more variables than env, sort of an advanced option for env

set | grep (something you need to check from env)   ---→    set | grep HISTSIZE 


Last updated