UNIX-1.7 Find Command


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: facebook.com/fuzicast
twitter: @fuzicast
youtube: youtube.com/yuejdesigner85

find . -iname ‘regex’ – find filenames that match regex, case insensitive
find . -mtime +2 – find files that were modified 2 days ago or older
find . -mtime -2 – find files that were modified within past 2 days
find . -ctime +2 – find files that were created 2 days or older
find . -atime +2 – find files that were accessed 2 days or older
find . -cmin +30 – find files that were created 30 minutes ago or older
find . -mmin +30 – find files that were modified 30 minutes ago or older
find . -empty – find empty files or directory
find . -executable – find files that are executable by user
find . -readable – find files that are readable by user
find . -writable – find files that are writable by user
find . -size filesize – find files that have specified filesize (c = byte, k = kb, M = Mb, G = Gb)
find . -type filetype – find by file type (d = directory, f = file, l = link)
find . -user username – find files owned by user
find . -group groupname – find files that belong to specific group
find . -name ‘regex’ -delete – remove files that match regex
find . -name ‘regex’ -exec command – execute command on files found
find . -name ‘regex’ -ok command – same as -exec, but prompts for user’s input

Advertisements

UNIX-1.2 UNIX Introduction and Basic Commands


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast
youtube: http://www.youtube.com/yuejdesigner85

Here are the list of unix commands used in this tutorial
file types
c – character file
b – block file
l – link
s – socket
/usr – stored application system files
/var – stores email, log files and such
/tmp – stores temporary files
uptime – host up time
w – current users in session
env – environment variables
clear – clears console screen
ctrl + u – clears command line
ctrl + a – move cursor to beginning of command line
ctrl + e – move cursor to end of command line
cat – spit out file content to standard output
tac – same as cat, but spit out file in reverse order
less – view file
more – view file
cal – calendar
top – view processes currently running

VIM-1.3 More VIM Editor Commands Tutorial


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

:tabdo %s/pattern/replacement/g – execute commands on all open tabs
:command1 | command2 – run multiple commands
:help
vim file1 file2 file3 – open multiple files
:n – go to next file
:only – when in split screen, close all other screens and keep current screen
. – repeats last action
:g/pattern/ – returns you all the lines that contains the pattern
:g/pattern/d – delete all lines that contains this pattern
:v/pattern/ – return all lines that don’t contain this pattern
:v/pattern/d – delete all lines that don’t contain this pattern
ctrl + o – the same as ‘.
: + up/down key – view history of : commands
/ + up/down key – view history of / searches
ctrl + w + (hyphen) – maximize the windows
ctrl + w + = – restore original windows
== – aligns line to same position as previous line
select block; :fold – compress lines, zo to expand, zc to compress again
:%s/pattern/replacement/gc – search and replace
ctrl + v ctrl + m – get special characters
:%d
:diffget – sync current screen with the other screen
]c – get to next diff