Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions
User Name
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.


  Search this Thread
Old 01-01-2018, 01:56 AM   #1
LQ Newbie
Registered: Jan 2017
Posts: 20

Rep: Reputation: Disabled
how to add command alias in ash shell?

im using openwrt that running ash shells
bit different from centos\ubuntu
so how to add a command alias such like
alias ll='ls -al'
and make it starts up after reboot?
Old 01-01-2018, 09:04 PM   #2
Senior Member
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,231
Blog Entries: 3

Rep: Reputation: 193Reputation: 193
Since you are using a shell add the alias to the profile.

My understanding is the profile can be found at either
System: /etc/profile
User: ~/.profile
1 members found this post helpful.
Old 06-22-2018, 11:44 AM   #3
LQ Newbie
Registered: Jun 2018
Posts: 3

Rep: Reputation: Disabled
For CentOS, that’s easy. Make new file or edit existing as follow:

nano /.bash_aliases
Add new line

alias log-ssh="cat /var/log/secure"
Where log-ssh (short command)
And cat /var/log/secure (Any SSH command)
Save file by press Ctrl + X then y Enter

Now use command source to load aliases

source /.bash_aliases
Try to type

Let me know if it works for you =)) best of luck

Last edited by i3z; 06-22-2018 at 11:47 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Add long command to an alias. linustalman Linux - General 9 10-31-2015 03:26 PM
[SOLVED] Busybox ash as a login shell prushik Linux - Software 2 05-01-2013 07:47 AM
[SOLVED] shell redefine the command akak alias DBabo Linux - Software 4 11-21-2012 02:18 PM
How do I make these shell scripts with ash as my shell? riahc3 Programming 13 08-15-2012 04:57 AM
Sarge - only ASH in shell no BASH jriis Debian 1 12-25-2003 04:25 PM > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration