Select Page

Some useful Unix/Linux Bash alias

Some useful Unix/Linux Bash alias

Some useful Bash #Linux alias taken from my user profile. If you have a long command that you type frequently consider putting it in as an alias.

In computing, alias is a command in various command line interpreters (shells) such as Unix shells, 4DOS/4NT and Windows PowerShell, which enables a replacement of a word with another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command. [WikiPedia]

Description 
Find all directories and and chmod them to rwxr.xr.xalias fixpermD=’find . -type d -exec chmod 755 {} \;’
Find all files and and chmod them to rw.r..r..alias fixpermF=’find . -type f -exec chmod 644 {} \;’
Both above and set recursively user and user group in one shotalias fixUserAPerms=’fixpermF; fixpermD; chown -R userA .;chgrp -R usergrp .’
Make a directory and all files recursively read only, secure but a pain to maintain. see next alias ro=’find . -type f -exec chmod 444 {} \;find . -type d -exec chmod 555 {} \;’
Make a directory and all files recursively read write, just the time to update your site.alias rw=’find . -type f -exec chmod 644 {} \;find . -type d -exec chmod 755 {} \;’
Lower case all files in current directoryalias lowercaseallfiles=’for f in *; do mv $f `echo $f | tr [:upper:] [:lower:]`; done’
List all open connections to your serveralias listOpenConnections=’lsof –i’
List all internet connectionsalias listinternetconnection=’netstat –lptu’
find the 10 biggest in size directoriesalias dirsizes=’du -cks * | sort -n | tail –10′
Show open portalias openports='netstat -nape --inet'
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Categories

0
Would love your thoughts, please comment.x
()
x