Ali The Expert

Logo

I’m a lazy developer but efficient

I’m a lazy developer but efficient

I automate everything to have time for inventing more

I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it

I am only a very lazy developer who wants to make everything much easier for everybody else.

I always find the best, most efficient ways of doing things simply because I am too lazy to do things the laborious way.

Short alias for longer commands

Like most people, I’m really tired of typing a long command on my command line or searching bash history for a previously typed command.

% ps auxf | sort -nr -k 4 | head -10

So, I use bash aliases to save me from having to remember the long commands:

% alias psmem10 = ‘ps auxf | sort -nr -k 4 | head -10’

Here’re some examples of aliases in my machine that I saved.
  • If you want to display a list of all your defined aliases, let give an alias built-in command without any arguments.
% alias
  • We must use the following syntax to create the alias.

% alias name=value
% alias name=’command’
% alias name=’command arg1 arg2′
% alias name=’/path/to/script’
% alias name=’/path/to/script.pl arg1′

  • If I want to clear the screen, I use the below alias.

% alias c=’clear’
% c

  • The following alias allows you to type r to repeat the previous command or r abc to repeat the last command line that began with abc:

% alias r=’fc -s’
% r

  • The following alias allows you to type r to repeat the previous command or r abc to repeat the last command line that began with abc:

% alias r=’fc -s’
% r

  • To save your time.

% alias h=’history’
% h

  • Show open ports

% alias ports=’netstat -tulanp’
% ports

  • Sort by file size

% alias lt=’ls –human-readable –size -1 -S –classify’
% lt

  • Sort by modification time

% alias left=’ls -t -1′
% left

  • If you need to know how many files are in a directory.

% alias count=’find . -type f | wc -l’
% count

In some cases, you’ll need to use the real command rather than an alias that already exists.

% \aliasname

It’s very good to share knowledge, you should share your aliases with everyone by leaving comments.

Scripts for automatic tasks
I will automate anything that can be automated.

I automate everything to have time for inventing more

Since everything becomes automated, I have time for myself to come up with many ideas and bring them to life.