General :: Alias Cd Cmd Way Whensover Enter Any Directory
Mar 12, 2010
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.
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:
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.
I have a big problem, I can`t enter to the system, said this:
mount: mounting /dev on /root/dev failed : no such file or directory mount: mounting /sys on /root/sys failed : no such file or directory mount: mounting /proc on /root/proc failed : no such file or directory
I have searched the forum high and low for the solution with no success, so I will now post this problem, with all known facts. Linux (and Fedora) is brand new to me so I'm somewhat illiterate with the language and recommendations from reading other threads. Please bare with me. I'm reading the book Beginning PHP and MySQL from Novice to Professional by Cristian Darie.The book has you create an Alias directory for creating the tshirtshop web-based application.
The book uses the directory /home/username/tshirtshop. However, I did not want this in the /home directory, so I created a new directory from the root directory /workspace/tshirtshop. Below are the areas of interest in the file httpd.conf (I restarted the httpd service each time I edited this file):
I don't know if this should be a followup to my prior topic [URL] ....
Each of the pieces I've installed all have an "Alias" directive in the conf file to link the directory where they live to be present on my server. For instance, DotClear lives in /usr/share/dotclear/web/ and there is a directive
Code: Select allAlias /dotclear /usr/share/dotclear/web that directs http://myserver/dotclear to that site.
Now, I've set up VirtualHost entries for my DotClear and Owncloud with their own hostnames.
The problem is when I go to [URL] ...., I get to my mythweb site.
This is not so good. So, for the sites that have their own hostnames, I removed the "Alias ..." directive. Of course, now I can't get to the hosts by going to the primary site which is probably fine, but I also still get my mythweb since that doesn't have it's own virtualhost entry.
This doesn't seem like correct behavior. Is there a better place to put the "Alias ..." directive so that it only works from one site and not all of them?
I am also thinking I should just link the directories into /var/www/html, but I'm not sure that's a better solution.
This should be a simple thing to accomplish, but I can seem to figure it out. Essentially, I want to have a bash alias or function that will let me recursively grep the current directory. A while back I added this to my .bashrc:
Code:
alias rg="grep -r --exclude=*/.svn/* --exclude=*.swp"
This works fine, (and also ignores any svn and vim swp files), and I can call it like:
Code:
rg foo *
However, 99.999% of the time, I am only interested in searching in the current directory, so the "*" is a bit redundant. Also, I would say 5-10% of the time, I am typing faster than thinking and forget the "*", so grep just sits there trying to read from stdin. It's a pretty minor thing, but ideally I'd like to be able to just type:
Code:
rg foo
I've tried creating a function to handle this:
Code:
function rg(){ grep -r --exclude=*/.svn/* --exclude=*.swp $1 * }
but it behaves exactly the same as the alias above. escaping the "*" with 's doesn't work, and neither does trying `pwd` (or even a hard-coded path) in its place.
Succeeded in connecting to internet using my wll phone. I can now connect using 'wvdial' command in root terminal. But I want to connect through terminal. I tried 'sudo wvdial' command. Then I am asked for my password. But I cannot type my password there. When I type, nothing appears on the terminal window. Ofcourse there's no problem with my keyboard.
I'm still pretty new to linux, and burning through a unix/linux course offered at the local JC. I'm working on an assignment for shell scripting and I need to make a script that displays a bunch of junk (pwd, date, yadda yadda) and then prompts the user to enter a directory so they can view the contents. If it's valid, then it displays the contents. If it isn't then it throws an error message and the script stops. This is done using if, then and else. The problem is, my script always shoots straight to the else, even if the subdir entered IS a valid subdirectory.Here's what I have:
When i try and log in with my user it is giving me an error I have removed gnome from the computer and put kde as my desktop I can login with root can't enter home directory using / is the error
I use ext4 for the lvm2 home partition on Fedora 11. Yesterday, I must shrink my home partition and the operation crashed. Then a new ext4 partition becomes a backup "cp -R /mnt/backup/* /home" + chown + chgrp and boot Fedora again.
The login failed and the message of Fedora is "Cannot enter home directory. Using /."
I've installed F14 to replace another distribution on my PC. I chose to use KDE. I used to have a separate partition for my user home to be mounted as /home. During the installation I instructed the installer to do so (without formatting of course). At the first boot I created a use with the very same name as I used to have. I got the warning about the home being already there and I said "yes, convert that ownership and selinux stuff so I can use that very directory as my home". At the graphical login I get a dialog saying I cannot enter my home and that it will use / instead. Of course the login process fails. If I switch to the character console (CTRL-ALT-F2) and do a login I actually get the very same error. But, if I hit "cd" (change directory to $HOME), then I get in the proper directory.
Update 1. I guessed it was a SELinux problem. And I manually disabled it into /etc/selinux/config. Now I'd like to fix this issue, because I'd like to have SELinux working.
I get this error when I boot opensuse default and fail safe. It takes me to a console log in, which works. This happened after new kernel install in Linux Mint, which is unbootable atm. I can boot windows, bsd but no Linux.
In GNU/Linux to GNU/Linux? For example there is some Samba-shared dir on Linux machine. And I wanna enter that dir from another Linux machine using Terminal or Virtual Console. In Windows it would start (if I'm not wrong) with "\...". Then a machne name and so on. But if I wanna do it in Linux, I personally only can use Gnome DE with its network..
I have a problem from time to time. Now is such a time. Nautilus is not able to read/enter my own home directory. It can enter/read ANY other directory, but my own home directory. Killing the Nautilus process, doesn't help. Logging out doesn't help. I need to reboot to get nautilus to read my home directory. Sometimes, it suddenly appears after a couple of minutes, but not always. What is taking so long time or causing the hanging? What should I do?
My purpose is to have a different history file for each directory. Because, it would be usefull for me to access only to commands executed in each directory. In this context, is there any way to update the HISTFILE variable every time I go in a directory?
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'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'?
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.
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
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'