Easier way to execute long commands?
I use a long mount command to mount a NAS drive but have to retype it every time I need to mount the drive. Because it is on my laptop I only need to mount the drive from time.
Is there an easier way to do this? |
put the equivalent mount config in your fstab command, or just put the command in a file and run it as a shell script. If yo ukeep your bash history, you can also just hit Ctrl-R and the type in something that is unique in the command like, and it'll provide that command out of your history for you.
|
If it was a fairly recent command, you can press up a couple of times until you get to the command that you want. If you want to mount every time you boot up, I am with acid_kewpie, add it to your /etc/fstab file, if you are not sure of how to do this, let us know.
|
Well, you could add it to fstab, as mentioned. You can make a script that does the mounting. You can also make an alias for that command.
You could also type history to get your history of you commands, then you can use !<num> or !<command> to execute the <num>'th command in the historyfile, or the last command matching <command>, i.e. Code:
$ mount /dev/hda /media/hd Code:
$ mount /dev/hda /media/hd There is a lot of possibilities :) |
Like said before, put it in fstab, but do add the user,noauto option. Then it won't be mounted automatically, it can be mounted by you as user, and you can mount it using either the device name, or the directory name of the mount point. Like:
Code:
/name.of.nas/with/long/dir/name /mnt/point/of/nas user,noauto 0 0 Code:
mount /mnt/point/of/nas jlinkels |
All times are GMT -5. The time now is 06:37 PM. |