What are your most important console aliases?

What alias would you like to keep if your .bash_alias / .bashrc / etc could contain only one line?

+4
source share
23 answers

alias ls = "ls --color"

+5
source

Technically not a pseudonym, but it eliminates the need for most of them.

source /etc/bash_completion 
+4
source

Found another convenient here: stackoverflow from Sanjaya R:

 alias mkcd='_(){ mkdir $1; cd $1; }; _' 

It's like mkdir foo; cd foo mkdir foo; cd foo just by calling mkcd foo .

See: How do I pass command-line arguments to a shell alias?

+4
source
 alias histgrep=history | grep 

Therefore, I can quickly find previous commands by simply typing

 histgrep <part of command> 

Like

 alias psgrep=ps -ef | grep 

to quickly find out if a particular process will be running.

+3
source

alias s = "cd .."

Stupid, but you cd all the time :)

+2
source

Perhaps my favorite:

 alias ff=find . -name $1 

For more aliases, my full bash profile is here

+2
source
 alias clean='rm -rf "#"* "."*~ *~ *.bak *.dvi *.aux *.log' 

Clear unnecessary files from the current folder.

+2
source

here is my windows "alias" that I use for all the Windows computers that I use:

C: \ Windows \ ls.bat

 dir $1 $2 $3 $4 
+2
source
 sudo apt-get install trash-cli; alias rm=trash 

I like when destructive commands have cancel buttons. Also, deletion is faster, and I don't need to specify -r to recursively delete.

+2
source
 alias ll="ls -al --color=auto" 

The first thing I do when I enter a new server; Gives much more readable dirlistings :)

+1
source
 alias sl=ls 

How many times a day does your left hand get an "s" before your right hand can get an "l"? :)

+1
source

alias webshare = 'python -c "import SimpleHTTPServer; SimpleHTTPServer.test ()"

+1
source

I use the dvorak keyboard, so the most important one is:

 alias no=ls -f 

my other favorite:

 alias devn='cat > /dev/nul' 

Which allows me to introduce random shit to myself, without worrying that it will ever be saved ...

+1
source

My most commonly used:

 alias la='ls -a -l' alias ll='ls -l' alias cats='konqueror http:'//icanhazcheezburger.com'' 

Last time is just a joke

+1
source
 #Useful find command to grep recursively for a string, usage "f blah" alias f='find . | tr "\n" "\0" | xargs -0 grep' #Some handy backtracking commands alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' #Reload .bashrc good for when working with new aliases :-) alias resource='source ~/.bashrc' #Good if on cygwin and have notpad++ installed alias edit='"/cygdrive/c/program files/notepad++/notepad++.exe"' #This one prints out a treelike structure of directories. alias tree='ls -R | grep ":$" | sed -e "s/:$//" -e "s/[^-][^\/]*\//--/g" -e "s/^/ /" -es/-/|/"' 
+1
source
 alias py='python2.5 -O' 
0
source
 alias ss="script/server" 

Clearly, I work in Rails most of the time. :)

0
source

alias prompt = 'PS1 =' \ '' [\ e [7m] \ u @ \ h \ A $ \ w> [\ e [27m] '\' ''

It is too difficult to enter every time you log in, and all the other dbas do not want the oracle user to have a non-default prompt.

0
source
 ### SSH That tunnels X stuff (even through NAT) alias 'xssh'='ssh -X -C -Y' 
0
source

I found that every time I edit the ~/.zshrc (or ~/.bashrc , for bash users), the next thing I always do is the source. So I made an alias:

 export EDITOR='/usr/bin/vim' alias zshrc='$EDITOR ~/.zshrc && source ~/.zshrc' 

Similarly, I added

 alias vimrc='$EDITOR ~/.vimrc' 

In addition, the suffix alias is very important for zsh users, for example:

 alias -s py=$EDITOR alias -s rb=$EDITOR 

so when you type test.py or foo.rb it will expand to $EDITOR test.py or $EDITOR foo.rb

0
source

I like this one

 alias ls='ls -lrta' 

and these

 alias ..='cd ..' alias ...='cd ../../../' alias ....='cd ../../../../' alias .....='cd ../../../../' 

and this one

 alias h='history' 

and especially this

 alias mkcd='_(){ mkdir -pv $1; cd $1; }; _' 
0
source

I listen to the mp4 music file while working, without music there is no life:

 alias m="mplayer -novideo -loop 0" 
0
source

How about this one.

alias bc = "vim ~ / .bash_profile; source ~ / .bash_profile"

0
source

Source: https://habr.com/ru/post/1276737/


All Articles