Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20th June 2012, 11:19 PM
Catarino Offline
Registered User
 
Join Date: Jun 2012
Location: Algarve
Posts: 4
linuxfirefox
i want to modify the "cd" change directory command

hi all
in my work i use ssh to connect to my servers
and i having a "problem" with the "cd" command
example
im in the /var/www/htdocs
and if i want to go to /var/www
i do "cd .."
ok
but in others linux distros i just do .. instead of cd ..
in fedora i get this message
# ..
bash: ..: command not found...
Similar commands are::
'..'
'.'

is there a way to change this?
Reply With Quote
  #2  
Old 20th June 2012, 11:48 PM
sdlor Offline
Registered User
 
Join Date: Mar 2008
Location: The Great Inland Northwest
Posts: 207
linuxchrome
Re: i want to modify the "cd" change directory command

You should be able to make a bash alias:
Code:
 [duke@Rock ~]$ alias ..='cd ..'
Do some research to find out how to make it persistent.
__________________
F17-PAE, 32 bit; GeForce GT 430
Reply With Quote
  #3  
Old 21st June 2012, 01:50 AM
dd_wizard's Avatar
dd_wizard Offline
Registered User
 
Join Date: Sep 2009
Posts: 1,409
linuxfirefox
Re: i want to modify the "cd" change directory command

Aliases belong in ~/.bashrc. And if you're running F17, here are a few more useful aliases:
Code:
$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific aliases and functions
alias ..='cd ..'
alias lld='ls -dl'
alias cdm='cd /run/media/gene/'
alias lsm='ls /run/media/gene'
alias llm='ls -l /run/media/gene'
Replace gene with your user name. F17 moved the media directory from / to /run/media/$USER.

dd_wizard
Reply With Quote
  #4  
Old 21st June 2012, 04:26 AM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: i want to modify the "cd" change directory command

Actually, the /media directory didn't get moved in F17.

What got changed is how Gnome automounts removable drives. That is what got changed in F17, and they are now mounted at /run/media/<username>
Reply With Quote
  #5  
Old 21st June 2012, 05:05 AM
flyingfsck Online
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,059
linuxfirefox
Re: i want to modify the "cd" change directory command

If you want the old mount behaviour, use XFCE, LXDE or KDE.
Reply With Quote
  #6  
Old 21st June 2012, 08:41 PM
dd_wizard's Avatar
dd_wizard Offline
Registered User
 
Join Date: Sep 2009
Posts: 1,409
linuxfirefox
Re: i want to modify the "cd" change directory command

Quote:
Originally Posted by flyingfsck View Post
If you want the old mount behaviour, use XFCE, LXDE or KDE.
Isn't that because they all still use udisks? I'm pretty sure that's the case for KDE, and I know that Gnome uses udisks2. I'm guessing that everybody will move to udisks2, eventually.

dd_wizard
Reply With Quote
  #7  
Old 21st June 2012, 10:27 PM
sea's Avatar
sea Online
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,608
linuxfirefox
Re: i want to modify the "cd" change directory command

You get udisk2 installed as well with lxde f17.
And thats when starting from a minimal installation.
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #8  
Old 22nd June 2012, 03:27 AM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: i want to modify the "cd" change directory command

Even in Gnome, you can change where it automounts a disk.

Open disk utility, click on the drive, then under the window where it shows the partitions, there is a little gears icon. Click on it, and select "Edit Mount Options" the change the mount point.
Reply With Quote
  #9  
Old 22nd June 2012, 10:41 AM
Catarino Offline
Registered User
 
Join Date: Jun 2012
Location: Algarve
Posts: 4
linuxfirefox
[SOLVED]: i want to modify the "cd" change directory command

thx to all
[Solved]
Reply With Quote
  #10  
Old 22nd June 2012, 11:04 AM
stevea's Avatar
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,302
linuxfirefox
Re: i want to modify the "cd" change directory command

but in others linux distros i just do .. instead of cd ..
in fedora i get this message


You are using a different shell or aliases/shell functions there.

First I would urge you to NOT become dependent on aliases and functions for short everyday commands. Many years ago I built a really extensive set of commands for some ancient VAPL environmnet or similar - and although it was very clean and convenient - I later found that I forgot how to use the basic commands well which made it very difficult to do anything without the magic bag of tricks.

So consider tricks like these ...
Quote:
alias ..='cd ..'
and particularly these
Quote:
colorls.sh: alias ll='ls -l' 2>/dev/null
colorls.sh: alias l.='ls -d .*' 2>/dev/null
alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
to be harmful.

aliases like ....
Quote:
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
that merely change default options (to prevent accidents) are useful.

Aliases that reduce tedious typing are fine, so I have no problem with ...
Quote:
alias cdm='cd /run/media/gene/'
alias lsm='ls /run/media/gene'
alias llm='ls -l /run/media/gene'
in principle, but it would be a lot better to just name the directory with a variabe ....
Quote:
export mymedia="/run/media/$USER"
then use the obvious commands
cd $mymedia
ls $mymedia
ls -ladR $mymedia

There is no advantage and a lot of limitations for aliasas vs shell functions, so
..(){ cd ..;}
instead of
alias ..='cd ..'
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
Reply

Tags
change, command, directory, modify

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Install "Change into... directory" Tirus Using Fedora 6 7th November 2010 12:18 AM
Smb Server how to config for Read, Write, Modify, Append, and "Don't delete file " ? nksvijayan Linux Chat 0 16th December 2009 04:08 PM
Dreaded vsftp "500 OOPS: cannot change directory" error *Not SELinux Related* DougWare Servers & Networking 1 12th September 2009 05:54 AM
Swapping "Command" and "Control" Keys on MacBook? SendDerek Mac Chat 3 22nd June 2009 12:29 AM
Fedora Core 9: Screen Resolution can not change from "800X600" to "1024X 768" csoftvietnam Using Fedora 7 26th August 2008 02:11 AM


Current GMT-time: 14:17 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat