Please enable JavaScript.
Coggle requires JavaScript to display documents.
command line (soft links (changing referenced file (changing back (link…
command line
soft links
shortcut
file
pointing to
another file
does not contain data
reference to original file
making
ln -s /source/file.txt /destination/filename
displaying with ls
lrwxrwxrwx
l stands for link
link-name -> referenced-filename-url
additional info
stat link-file-name
symbolic link
directory
same as file
ln -s /url/directory-name /url/directory-shortcut
changing referenced file
link can no longer see the file
link is highlighted
changing back
link works again
deleting
unlink link-name
files archiving
tar
used for making backups
of data
creating archive
tar -cvf archive-name.tar folder-name
use
restoring files
extracting
tar -xvf archive-name.tar
-x
extract
viewing content
tar -tvf archive-name.tar
adding to existing archive
tar -rvf archive-name.tar filename
hard links
differences
#
hard link
like file
not shortcut
same size
as original file
no l in permission
clones the file
with the same properties
stat
regular file
instead of symbolic link
ln
no triggers
changing hard link file
changes original file
deleting original file
hard link still works
deleting
unlink hard-link-name
hard-link-name~
copy of hardlink
before making changes
files compressing
gzip
quicker
gzip filename
multiple files
gzip filename1 filename2
extracting
gzip -d filename.gz
gunzip filename
file extension
.gz
bzip2
less space
bzip2 filename
file extension
.bz2
multiple files
bzip2 filename1 filename2
extracting
bunzip2 filename
different compression algorithms
tar
#
tar -zcvf archive-name.tar.gz directory-name
-z
compress file
with gzip
tar -jcvf archive-name.tar.bz2 directory-name
-j
compress file
with bzip2
extracting
tar -xvf archive-name.tar.gz
tar -xvf archive-name.tar.bz2
view contents
tar -tvf archive-name.tar.gz
tar -tvf archive-name.tar.bz2
pipes
|
combining commands
first command output
becomes
input of next command
example
ls | less
redirect
>
take the result of command
save it in a file
example
ls > ls.txt
seq
seq 10
counting to 10
seq 1000000 > file
creates file with million lines
ls
switches
-l
shows permissions
-lh
shows file sizes
-a
shows hidden
files
directories