Linux Command Line Flashcards
Command to list files and directories with detailed information?
ls -l
List hidden files?
ls -a
List Files and Directories with ‘/’ Character at the end
ls -F
Recursively list Sub-Directories
ls -R
Sort Files by File Size
ls -IS
List files in Reverse Output Order
ls -ltr
List files in the /dir directory
ls -l /dir
List info about the /dir directory?
ls -ld /dir
Commands to shut down the OS?
halt, ‘init 0’ or ‘shutdown -H’
Commands to reboot the OS
reboot , ‘init 6’ or ‘shutdown -r’
How to end a terminal session?
exit
How to elevate to root user?
su -
Command to show the environment settings?
env
How to view ip config for network card?
ifconfig or ‘ip addr’
To kommandoer for å finne hvor vim er installert?
which vim
whereis vim
Kommando for å vise hvillen mappe du står i?
pwd
Hvordan gå tilbake til forrige mappe?
cd -
Kommando for for grafisk å vise mappestruktur?
tree
List innhold i mappe (ikke ls..)?
ll
Hvordan lage hard link mellom fil t1.txt and t2.txt?
ln t1.txt t2.txt
Hvodan sjekke om to filer (file1 og file2) er hard linket?
ls -li file1 file2
(The -i option to ls prints out in the first column the inode number, which is a unique quantity for each file object. )
Hvoran lage en tom fil f1.txt?
touch f1.txt
Hvordan lage en soft link mellom file1 og file3
ln -s file1 file3
(ls -li file1 file3
Notice file3 no longer appears to be a regular file, and it clearly points to file1 and has a different inode number.)
Kommando for å se fil?
cat