Skip to content

Notes for 103.3 and nice to know

Notes for 103.3 and nice to know published on No Comments on Notes for 103.3 and nice to know

Change time stamp of a file:
touch -t YYYYMMDDhhmm.ss myfile
 
show full time stamp
ls -la --time-style=full-iso myfile

wildcards

? = replace one char
* = replace 0 or x chars
[a-z] = replace one char in the specified range
[abcde] = replace one char of the specified characters
[!a-z] = replace one char NOT in the specified range

tar

Not well known options
t = list
tar tzf salami.tar.gz

zipping the shit out of the files

gzip -c myfile.txt > myfile.txt.gz creates a myfile.txt.gz and does not delete the original myfile.txt
gzip -l myfile.gz lists the content of myfile.gz

decompress with:

  • gzip -d
  • gunzip
  • zcat

bzip2 has usually better compress rate. It uses the same parameters.
decompress with:

  • bzip2 -d
  • bunzip
  • bzcat

cpio

extract files out of archives
cpio -i | --extract = copy in mode; copy from archive in file system
cpio -o | --create = copy out mode; copy files into the archive
cpio -p | --pass-throughno archive, all files of stdin into a dir

backup all ods in home to backup
find /home/ -name *.ods | cpio -pd /backup

-d = creates directories

dd

backup mbr
dd if=/dev/sda of=mbr.backup ibs=512 count=1

file myfile.sh shows the type of the file

Leave a Reply