LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-01-2018, 01:56 AM   #1
rhinolt
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
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,178
Blog Entries: 3

Rep: Reputation: 187Reputation: 187
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
i3z
LQ Newbie
 
Registered: Jun 2018
Posts: 3

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

Code:
nano /.bash_aliases
Add new line

Code:
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

Code:
source /.bash_aliases
Try to type

Code:
log-ssh
Let me know if it works for you =)) best of luck

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 01:05 PM.

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