LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2009, 01:38 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Rep: Reputation: 49
rules for terminal are too strict.Is there any alternative?


Hello,
I am using openSUSE 10.3.when i use the terminal to copy file,change directory etc.I find that If the name begins with capital letter and I write a small one then there is an error.In DOS you can write first few letters(case insignificant) of folder.Is there a way to ask terminal to ignore the case.
 
Old 03-02-2009, 01:42 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Linux filesystems are case sensitive.
You can use auto completition to reduce the amount of typing.

Last edited by jschiwal; 03-02-2009 at 06:36 AM.
 
Old 03-02-2009, 01:43 AM   #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
Nix's are case sensitive, so I doubt it. It is perfectly valid to have two files called "Test" and "test", and they are different files.
 
Old 03-02-2009, 02:22 AM   #4
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
To jschiwal,
What is auto competition.
To billymayday,
You mean i have to remember the case of file and name.Is there a way so that terminal can suggest file & folder name while I type irrespective of the case.
 
Old 03-02-2009, 02:29 AM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Hit Tab for it to complete the word as far as possible, double hit tab to show all possible suggestions based on what is currently writen, used for when you are writing paths.

Last edited by r3sistance; 03-02-2009 at 02:46 AM. Reason: spelling correction.
 
Old 03-02-2009, 02:33 AM   #6
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
He meant "auto completion", which is where you can press "tab" part way though typing a command and the terminal will attempt to complete the typing for you. Try it.

Yes, I think you need to remember the case of the file.
 
Old 03-02-2009, 06:40 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You can enable cdspell to correct small errors in the spelling of the directories in the cd command. Also look at `^-r' which allows you to type just a few characters of a previous command to select it from the history buffer.

---

Thanks, billymayday. I fixed the typo.

Last edited by jschiwal; 03-02-2009 at 06:41 AM.
 
Old 03-04-2009, 12:54 AM   #8
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
Am I right ?

to jschiwal,
I came to know that

To enable cdspell in your Bash, give following command:
#shopt –S cdspell
Your command interpreter is ready to check and correct spelling errors in change directory command.

I will try this.
 
Old 03-04-2009, 01:22 AM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
It really can be implemented at application level, so it's up to the shell. This is what wine does, for example. I have no idea if bash, ksh, zsh or any other can do what you do in a convenient way. BUT (and it's a big BUT) don't complain later if the rest of the applications break for odd reasons related to the case of the file names. Remember that, at the underlying level, "TEST " and "test" will be two different files, and that can create confusion and lots of headaches. Also, note that even if you manager to implement this at shell level, that doesn't mean a thing about the rest of your applications.

I -for one- wouldn't do such a thing when running as root (you can really mess up your system and break things if you go arbitrarily naming important system files in a wrong way).

Last, but not least, linux is really a case sensitive system from the root, I'd just learn to live with it. I fail to see the problem. If your concern is that sometimes you are confused because you end with duplicate files like "TEST", "test" and "Test", you should know that faking up your shell is not going to fix that at all. For that you would need to change the filesystem drivers.
 
Old 03-04-2009, 02:48 AM   #10
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
Quote:
Originally Posted by i92guboj View Post
Last, but not least, linux is really a case sensitive system from the root, I'd just learn to live with it. I fail to see the problem. If your concern is that sometimes you are confused because you end with duplicate files like "TEST", "test" and "Test", you should know that faking up your shell is not going to fix that at all. For that you would need to change the filesystem drivers.
Well put
 
Old 03-04-2009, 11:36 PM   #11
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
I just meant that if I write doa and there is a file named DOA then on pressing tab written letters should change to UPPER case and if there is file named Doa then another tab should change written letters to Doa like it happens in DOS.But now I know linux terminal different from DOS so no problem.
Thanks for suggesting spellcheck feature.
 
Old 03-04-2009, 11:45 PM   #12
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,226

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
another good shortcut to experiment
try typing 'history' at the shell prompt
you should see an output like thus
Code:
   17  cat smb.conf
   18  ls
   19  kwrite smb.conf
   20  ls
   21  cat smbusers
   22  ls
   23  kwrite smb.conf
   24  fdisk -l
   25  mount /dev/sde1 /mnt/drive
   26  mount /dev/sde1 /mnt/drive
   27  mount /dev/sde1 /mnt/drive
   28  apt-get install ntfs-3g
   29  mount /dev/sde1 /mnt/drive
   30  cd /mnt/drive
   31  ls
   32  cp -rv World* /root/.wine/drive_c/program_files
   33  ls
   34  cd
it shows a history of the last 1000 or so commands you have used , if you want to use one of those commands again without having to type it all over again just type !# where # is the corresponding number in the history list for instance i see
[code]
27 mount /dev/sde1 /mnt/drive
[code]
you could re-issue that command by typing !27 at the prompt
try doing THAT in dos

Last edited by frieza; 03-04-2009 at 11:46 PM.
 
Old 03-05-2009, 12:05 AM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by frieza View Post
try doing THAT in dos
It was actually easy to do the same, if you knew how to properly use doskey.exe. It wasn't quite as powerful as the linux shells history, but it was enough for the basic procedure that you describe.


Quote:
Originally Posted by sumeet inani View Post
I just meant that if I write doa and there is a file named DOA then on pressing tab written letters should change to UPPER case and if there is file named Doa then another tab should change written letters to Doa like it happens in DOS.But now I know linux terminal different from DOS so no problem.
Thanks for suggesting spellcheck feature.
Mmm, so all you wanted was a more flexible autocompletion feature. Now that I think that could be done by putting this line in your ~/.inputrc file (as long as your shell supports readline (bash do and most distros will have that feature compiled into bash).

Code:
set completion-ignore-case On

Then open a new bash session and try it. If you have a dir called TMP and you write cd tm[tab] it should autocomplete just fine AND adjust the part that has already been written to match the true name of the file or directory, as long as there no other match. If there're many matches it will do nothing but if you TAB again it will show all of them, just like bash do usually, but disregarding case sensitivity.

Last edited by i92guboj; 03-05-2009 at 12:13 AM.
 
Old 03-05-2009, 12:08 AM   #14
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,226

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
yes i know doskey, that functionality is the same in alot of linux shells, just hit the 'up' and 'down' arrow keys to cycle through the history, rather cumbersome when you have to go through nearly 1000 commands to find the one you want though, hence the try THAT in dos
 
Old 03-05-2009, 12:20 AM   #15
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by frieza View Post
yes i know doskey, that functionality is the same in alot of linux shells, just hit the 'up' and 'down' arrow keys to cycle through the history, rather cumbersome when you have to go through nearly 1000 commands to find the one you want though, hence the try THAT in dos
Actually with doskey you could press f7 to show the history, and f9 + number to choose one command. Different modus operandi, but quite the same functionality that you described: list the history and run an arbitrary command on that list. It could do a few more things like auto completing a command with something already in the history (f8). All these, provided that my memory is still working at it should
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc 4.0.0 warning: dereferencing type-punned pointer will break strict-aliasing rules stephenwalter Programming 4 06-10-2009 05:06 AM
Is VNC a viable alternative to Terminal Server? ibkoxls Linux - Software 1 12-26-2008 01:46 PM
Alternative to zgv for terminal graphics? longtex Linux - Software 2 11-09-2005 10:18 AM
Using Firestarter ... Can I Add/Drop rules from a terminal prompt? rickh Linux - Security 1 06-15-2005 04:21 AM
Alternative terminal to konsole & gnome-terminal Adony Linux - Software 3 10-08-2004 04:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration