LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2008, 05:32 PM   #1
JSLayton
Member
 
Registered: Apr 2005
Location: Warrior, AL
Distribution: Slackware 10.1, Fedora Core 4
Posts: 128

Rep: Reputation: 15
command shortcut


I am used to typing 'l' on another system to show the contents of a directory, but on this box it would show them as if I had typed 'ls -l'. Is there a way to make just typing 'l' refer to 'ls -l'??
 
Old 08-09-2008, 05:34 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Add

alias l='ls -l'

to ~/.bashrc (that is, the file .bashrc in your home directory)
 
Old 08-09-2008, 05:39 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quickest way is probably to start a terminal session, then type

echo "alias l='ls -l'" >> ~/.bashrc

I don't think it will take effect until you login again
 
Old 08-09-2008, 08:33 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Actually, the string 'll' is often already aliased to 'ls -l' on Linux. Try that first.
 
Old 08-09-2008, 11:16 PM   #5
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246
Blog Entries: 1

Rep: Reputation: 31
Better ask the OP what shell he is using, may not be BASH.
 
Old 08-10-2008, 12:09 AM   #6
JSLayton
Member
 
Registered: Apr 2005
Location: Warrior, AL
Distribution: Slackware 10.1, Fedora Core 4
Posts: 128

Original Poster
Rep: Reputation: 15
Yes, it is the bash shell and it is working perfectly. That is exactly what I was looking for.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run command shortcut+suse 10.2 abominable SUSE / openSUSE 11 07-02-2007 11:10 PM
Command Line for creating shortcut icons indraveni Linux - General 20 05-08-2006 11:46 PM
g++ command shortcut? m_lp_ql_m Linux - Software 5 02-17-2006 08:42 PM
Execute shortcut as Root Command? batorma Linux - Newbie 2 11-08-2005 02:22 PM
KDE3 execute command on keyboard shortcut hamsterdude Linux - General 10 07-21-2003 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:27 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
Open Source Consulting | Domain Registration