LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-12-2011, 07:59 AM   #1
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Rep: Reputation: 15
Alter bash command


Greetings, I want to automatically append flags to certain commands. For example, when I type:

ls

at the prompt, I want the

-la

flags automatically appended without me having to type:

ls -la

How is this done?
 
Old 02-12-2011, 08:15 AM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
You want to set up an alias.

Code:
alias ls='ls -la'
If you want to make it persistant with each login put it in your profile. (.bashrc in your home directory is a good place if you are using the bash shell.)

Type just 'alias' to see what you may already have set.

Last edited by tommylovell; 02-12-2011 at 08:18 AM.
 
1 members found this post helpful.
Old 02-12-2011, 08:35 AM   #3
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Original Poster
Rep: Reputation: 15
Perfect, thank you!
 
  


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
[SOLVED] How write a literal bash command in a bash file? xeon123 Linux - Newbie 6 11-29-2010 12:05 PM
Bash history delete command from bash itself ashishag Linux - Software 6 05-02-2010 03:39 AM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 11:10 AM
Bash script to read file and alter lines depending on create date ChristianHein Linux - General 13 08-04-2007 05:39 AM

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

All times are GMT -5. The time now is 01:16 AM.

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