cygwin alias to C drive doesn't work [closed] - cygwin

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I've created an alias in my bashrc like this:
alias workspace='/cygdrive/c/'
I thought I could use it in cygwin like cd workspace but then I get the error that
/cygdrive/c/ is a map.
I tried to delete / before cygdrive and after c but nothing works. Is it not possible to create an alias like this?

workspace=/cygdrive/c; cd $workspace
or
ln -s '/cygdrive/c' ~/workspace ; cd ~/workspace
but i still have no idea why some should use this

It works for me: alias workspace='cd /cygdrive/c/'

If you do it like this:
alias workspace='cd /cygdrive/c/Users/bla'
then you just need to type workspace and you're in the right directory :-)

Related

How to alias or rename a file on the fly in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have the following challenge under Linux:
An application is writing a config-file "samename.cfg" into certain directories
I want to have the config-file named different for each directory
I do not want any file called "samename.cfg" written to the directories
I can not change it in the application
So I would like to have the application thinking that it accesses samename.cfg but in fact it reads and writes anothername.cfg. Symlink does not help, because then there still is a file called samename.cfg in every directory.
Anybody any idea?
Regards,
Axel
Try using a hard link instead of a soft link when using ln command (just remove the -s flag).
See ln man's page for more details.

How to add alternative to program that located in /usr/bin [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Is it possible to substitute binary with same name alternative? I have /usr/bin/qtcreator
I want to use alternative version but /usr/bin/qtcreator is binary but not alternative.
What the way I should do this?
You could place your new qtcreator at /usr/local/bin/qtcreator, that location should have preference over /usr/bin.
You can check the possible locations for binaries and the order is which they are searched with echo $PATH and you can check which binary will be called with which qtcreator
In Bash:
$ alias qtcreator="/usr/local/bin/qtcreator"
or make sure the path to desired binary is mentioned before the undesired path in $PATH (... as mentioned by others).

make 'srm' the default command instead 'rm' in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I want force users to use 'srm' instead of 'rm' command. is there any solution to execute 'srm' command when users run rm command? or deny users permissions to run 'rm'?
Just create an alias:
alias rm='srm'
You can put this command in the .bashrc file for the user you have to keep under control, so that it is automatically loaded at login.
You can also put it into /etc/bashrc, so that it's loaded for ALL the users.
You can use aliases to do this.
Create an alias as ,
alais rm="srm"
Add this in to the bash_profile or bashrc file or even better create a bash_alias file that will be called from bashrc file.
For a general intro on Aliases, refer this http://bit.do/freblogg-aliases

is there a way to do Linux ifup or ifdown in bash without always having to type sudo first? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
For ifup/ifdown, service, and other commands, is there a way around always needing to type sudo first?
Linux version is 3.8.13-bone67
the simplest way:
add the following in your ~/.bashrc:
alias ifup='sudo /usr/bin/ifup'
(or whatever is the path to your ifup binary. If you don't know the path, you can find out using which ifup)
You then have to enter your password as regular. To also avoid typing the password, you can add an entry into your sudoers file.
Use $ sudo visudo to edit it (will use the editor defined in $EDITOR or vi) and add a line like the following to the end:
ALL ALL = NOPASSWD: /full/path/and/full/command
Sources:
https://wiki.archlinux.org/index.php/Sudo#Configuration

Is it possible to create more than one directory on a same command? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I took an examination last week and there was a question asking to create three directories by using one command ; then there was a question asking to delete those directories on a same command. Is that possible ?
You should read man mkdir and man rm
mkdir -pv myfolder/{a..z}/{1..10}
creates 261 folders (myfolder/a/1, myfolder/a/2.... myfolder/z/10)
rm -rf myfolder/
removes them all
Yes this is possible.
Check here and here
Removing directories in one command is also possible. Check here

Resources