General :: How To Save Alias Permanent
Nov 5, 2009how to save alias permanent
View 4 Replieshow to save alias permanent
View 4 RepliesI am going through and old .cshrc file and it contains the following alias:
alias pwd 'echo $cwd'
I used to think that this is how pwd might have been implemented. But looks like thats not the case (because then this alias is meaningless).
I was trying to add new alias "alias ls='ls --color=auto'" in .profile, but it never worked I displayed all the alias that are current available and did not see the one I just added and found this among them:
lsls $LS_OPTIONS
and the LS_OPTIONS is "-N --color=none -T 0"
this is in /etc/csh.cshrc file which I do not have permission to edit.
Is there way to overwrite it?
Also I do not see a .cshrc under my home directory. Can I just make one and source it? Or do I have to link it to some source file that already exists?
I would like to use something like a 'cdl' alias that would cd into the directory i choose and then ls the contents automatically. I find myself using ls after i cd into a directory all the time. Something like:
alias='cdl=cd $1;ls'
usage: cdl /local/dir
I'm testing out the aliases to have a better understanding on how to shorten commands. I am trying to list all files whose file names end with a .c extension in which starts from the current working directory and recursing through subdirectories as well. And I want to delay the path name expansion until the alias is executed. I want to use the directory /usr/share. Would the command be: alias findc='find -type d -exec /usr/share'?
View 3 Replies View Relatedi have to set up a alias like:alias ll='ls -l'them ll will work
View 2 Replies View RelatedI'm using Links on a Ubuntu server, and to view images I'm using Asciiview, which works well, but the association is not retained whenever I close links. How can I retain this association?
View 1 Replies View RelatedUbuntu 10.04 64-bit
Partition on HD
/root
/home
[code]....
I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:
alias rm=trash This works fine as a normal user, and it works fine when I use sudo -i to get a root shell prompt, but if I use sudo rm, the alias does not apply. So where do I need to put my alias so that it works in one-off sudo commands?
I'm running Utorrent server and I figure I would create an alias to launch the program and run it in the background.alias utorrent='/home/user1/software/utorrent-server-3.0/utserver &'It seems to run the program but the associated webui program is flaky and won't start correctly.If I manually go to the specified path and run the command ./utserver & , I never seem to have an issue with the webui.I was wondering if this could possibly have anything to do with using the '&' ampersand operator in an alias.
View 2 Replies View RelatedI tried this to set an alias: alias lsf='ls -f' and it works fine... But when I put it in a bash script it doesnt work. SCRIPT:
cd ~
alias lsf='ls -F'
lsf
I get the following output: line 3: lsf: command not found
I used the alias command to make ll be ll -lrt. I have linux 5 and using the bash shell. now I can't even use ll, only ls. when I go into the bin directory, ll is not in the list and the normal color codes for bash are not showing either...folders blue, etc
View 4 Replies View RelatedI have a Finnix live CD. I can customize it by remastering it. When I boot with the live CD I need to make a little change in the boot profileThe boot profile before making the changes islinux apm=power-off vga=791 initrd=minirt quiethe boot profile after making the change become linux apm=power-off vga=791 initrd=minirt quiet root=/dev/sr0Now, I need to make this change (adding root=/dev/sr0) permanent. How can I do that?
View 1 Replies View RelatedI have just booted to Puppy (for the first time in my life) on a 6 y/o amd type with a 40Gb HD, Ram: 512.I would like to make a permanent install of puppy onto the HD, I have read various pieces on how to install, defraging, repartitioning, differing file systems. However, i am a bit lost. The computer will be used for e-mail, web browsing, and watching the odd film (films installed on the drive) - I am unsure as to the best combination of file types and partition in order to keep puppy happy and keep some compatibility with the world outside of linux.
For instance, could i have a small partition with the puppy install and setting, and the rest on a format that would be compatible with windows/mac/linux? If so, how do I do this, pls bare in mind that my windows install is running but incomplete. I have the feeling this will be a really simple problem for someone to help me with,
I have a c file, and I want to open it but not in the terminal. After changing the permission, I tried: vi, pico, ed and vim. But, all open it in the terminal. How can I change the permission of that file to be opened and edited not in the terminal? When I change the permission from the terminal, it only let me edit it through the terminal, and when I check the permission of the file I see it as was it (no change). I need a permanent permission. Although, I command as a root.
View 7 Replies View RelatedWhen I enter my bootloader Grub I have to go to the system I want to load and press e to edit. Then I add vga=792 in the end of one line to change the tty resolution. How can I make this change permanent? My distribution is Debian Squeeze and there is no menu.lst in squeeze.
View 6 Replies View RelatedI need to occasionally touch a file with the current timestamp as the filename. I would do so this way:
touch `date "+%Y-%m-%d_%H-%M"`.txt
However, I'd like to define an alias for this. When I try adding to the bashrc this:
alias td="touch `date "+%Y-%m-%d_%H-%M"`.txt"
the result is that the filename is the same during the entire session, since the `date ..` gets calculated just once during login...
How can I get the command to expand only when I call the alias? Or must I use a function for this?
In my laptop, if I type below
$ which vi
alias vi='vim'
/usr/bin/vim
Now I want to change the vi alias to another bin, e.g. vim_wrapper a script created in /usr/bin/, I type this line:
alias vi="vim_wrapper"
in ~/.bashrc or /etc/bashrc, but take no effects. So How to change the default vi alias vi='vim' to vi='vim_wrapper'?
I need to make a alias and I am a little confussed how to do it. As some websites say it has to be in profile and other says it goes in bashrc.on the server I have these files
bash_historybash_profilebashrccshrcdtprofileloginmysql_historynewsrcI been trying to do this and think may have problem now as when I log in I get error it says bash_profile syntax error unexpected token 'fi'
the problem is that i want to alias my cd cmd in such a way that whensover i enter any directory, a ls cmd i automatically performed. i tried ' alias cd='cd $1;ls' , but it is not working.
View 5 Replies View RelatedI have trouble with using an alias inside aash function. I would like to ssh into multiple machines by executing:ssh machine To achieve this, I put something like the following into my ~/.bashrc:
alias machine='user@machine'
ssh()
{
[code]....
I have a CentOS running. It is important to have my CentOS available when I am remotely connected to a VPN router. I tried to add a default gateway to the VPN router, but after reboot it goes away. How can i put this as permanent?
ip route add 192.168.2.3 via 10.0.0.1 dev eth0
I need to add rootdelay=130 to my grub menu every time I boot up. how to edting (which) appropriate file to make a permanent change?
View 2 Replies View RelatedI have a generic monitor which has problems with many Linux distros. We can boos Sugar on a Stick v2 by pressing <tab> at the Sugar splash screen and adding the boot parameter "nomodeset". I'm handy enough to do this, but my wife, well, not so much. So is there a way to make that boot parameter permanent?
View 1 Replies View RelatedI have packer installed for AUR packages, but I want to be able to use the pacman command for both. I think I will need a function for this -- what I mean is that whenever I use pacman, it will try using packer and if that fails (invalid option) it will use pacman-color. It could also decide which program to use based on the arguments. I can't just use packer (alias pacman='sudo packer') because packer doesn't have some options like -R to remove packages. I want to always use it to install and upgrade packages however, because It can install from the default repositories as well as AUR.
Does someone know how to accomplish this, or could point me in the right direction? I'm new to bash scripting. error (e.g. pacman -V prints packer: Option '-V' is not valid.).
I would like to create several aliases to eth0, but have the addresses assigned by DHCP instead of being set to static IP's. Is this even possible? All the examples I've seen assign a static IP using the command:
ifconfig eth0:0 192.168.1.11 up
When at the command line, I find that I have to type out this command very often: find . -iname "*php" -exec grep -H query {} ; I'd love to set up an alias, script, or shortcut to make it work easier. I would like to do something like: mysearch query ("*php") (.) It would be great if the command could accept three arguments, in reverse order:
query string, file name expression, directory If the second two arguments were omitted they would default to not being included, and the current directory. Finally, the icing on the cake would be that if additional variables were included (4th, 5th, 6th...) they would be injected as additional arguments for the find command (like I could say -type d) at the end. Attempted code I tried the example below, but I'm still having trouble setting default values. What am I doing wrong?
#!/bin/bash
c=${param1+.}
b=${param2+*}
a=${param3+test}
find $c -iname $b -exec grep -H $a {} ;
I know that using alias I can run a whole command with a shortcut. But my requirement is to use parts of a long command and in between I have to pass some user defined values.
E.g. Suppose I have to routinely copy a directory to another remote directory on a remote machine.The remote machine name is quite long as well as the directory path to which I want to copy the files into.So the command to do scp would look like this[URL]Now I want to do some sort of aliasing (say "ecp") so that I just need to pass the source_directory name and the ecp command and do my job
I'm trying to setup an alias, that when I change to another directory, any directory, it will also display all its contents like ls -al:Well, that doesn't work. I guess it's an issue with the use of wild-cards.Maybe I should define a new, so far unused, name for the alias like cdl for example.Would be great if someone could help me. I search in several examples for bash aliases but couldn't find the right solution.
View 9 Replies View RelatedI have a program which mounts /dev/sdb1 for which I lack the source code. This device does not exist on my RedHat 9 system and I want to create /dev/sdb1 such that it's an alias for /dev/hdb1 Can I do this? with MAKEDEV?
I need to have an alias which will allow it to mount, not create a symbolic link to an already mounted directory. i.e. 'mount /dev/sdb1 /mnt/harddrive' should actually mount /dev/hdb1