XXIIVV
Static picture
18U01 — Static

Unix is a family of computer operating systems that derive from the original Unix from Bell Labs.

This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

Expect the output of every program to become the input to another, as yet unknown, program. Don’t clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don’t insist on interactive input.

jargon

Primitives

lsList files in the directory
cdChange directory
rmRemove file or directory(-r)
cpCopy file or directory(-r)
mvMove file or directory
wcCount words in file
manRead the manual
catReads content of files sequentially
mkdirMake new directory
dateShow system date
grepSearches text for matches of a regular expression
tailDisplays the tail end of a file or data

copy a file

$ cp readme.txt documents/

duplicate a file

$ cp readme.txt readme.bak.txt

copy a directory

$ cp -a myMusic myMedia/

duplicate a directory

$ cp -a myMusic/ myMedia/

move a file

$ mv readme.txt documents/

move a directory

$ mv myMedia myMusic/

rename a directory

$ mv myMedia/ myMusic/

merge directories

$ rsync -a /images/ /images2/

create a new file

$ touch 'new file'

create a new directory

$ mkdir 'untitled folder'

show file/directory size

$ du -sh node_modules/

show file/directory info

$ stat readme.md

open a file with the default program

$ xdg-open file   # on Linux

zip a directory

$ zip -r archive_name.zip folder_to_compress

unzip a directory

$ unzip archive_name.zip

peek files in a zip file

$ unzip -l archive_name.zip

remove a file

$ rm my_useless_file
$ rm -r my_useless_folder

list directory contents

$ ls my_folder        # Simple

tree view a directory and its subdirectories

$ tree

find a stale file

$ find my_folder -mtime +5

view content of a file

$ cat apps/settings.py

search for a text

$ grep -i "Query" file.txt

Pipes

ls > fooSend output from ls into file foo
wc < fooReceive input from file foo into wc
ls | wcConnect output of ls into input of wc

Options

-aAll, Append-nNumber
-bBuffer, Batch-oOutput
-cCommand, Check-pPort
-dDebug, Delete, Directory-qQuiet, Quit
-eExecute, Edit-rRecurse
-fFile, Force-sSilent
-gGroup-tTag
-hHeaders, Help-uUser
-iInteractive-vVerbose, Version
-j-wWidth
-kKeep-xExtract
-lList-yYes
-mMessage-z
— Submit an edit to unix.htm(109 lines)
Plan 9 is a fully-featured, clean, compact and uniform operating system built as a successor to Unix. picture
plan9 — Plan 9 is a fully-featured, clean, compact and uniform operating system built as a successor to Unix.

incoming(1): firth

Last update on 20K12, edited 2 times. +9/16fh-----+