How to delete a folder or a file from usr/bin in linux/fedora - linux

I am using fedora ,
Unfortunately i had downloaded a package(for example 'selenium' or 'chrome') in the bin folder.
But i don't want that package in the bin folder, i want to remove it from the folder, i am unable do it manually as well as from the the terminal, so can anyone let me know how to delete a package from bin folder.
Actually i am trying to download a package as below from terminal
svn checkout http://selenium.googlecode.com/svn/trunk/ selenium-
read-only
But i didn't see my path in terminal when i am downloading i.e., usr/bin , so the package has been downloaded in bin folder now.
Please help me out through this.

the /usr/bin folder is a protected folder which usually root user have full access to it
so if you want to make a change in it you should have a full access which can gain by "su" or "sudo" commands
try these commands on your terminal
su
<type your root password>
cd /usr/bin
rm <your special file names you want to remove>
you can do it by sudo too
cd /usr/bin
sudo rm <your special file names you want to remove>
<type your root password>

You don't have privileges of deleting a file or folder in the /usr/ directory unless you are the root user. Therefore you can do that by right-clicking on the /usr/ directory and Open as root. This gives you the rights of the root in that directory.

Related

How to make directory at Linux root directory from terminal when in sub-directory?

Background: OS is Debian GNU/Linux.
I am trying to make a directory at root, when I am in a sub-directory. In other words, let's say I am at the directory /a/b/c, and I want to make a directory at the root level, called d. How do I go about doing that?
In case you can't tell, I also don't know all the right wording/terms.
UPDATE: I did not understand difference between home directory and root directory. I learned about pwd command, and that solved the problem. What I actually wanted was to make a directory within the home directory.
Assuming that you have the required permissions, you could do mkdir /d.
It should be like sudo mkdir /name_of_directory

Cannot copy contents of Wordpress directory to the web server root

I'm a total newbie at this!
I have a virtual machine running Debian 9. I have LAMP installed.
I am following the instructions at this link to install WordPress:
https://www.adminbyaccident.com/gnu-linux/how-to-install-wordpress-on-debian-9-lamp-stack/
I am now at this step:
We now copy the contents of the wordpress directory to the web server root.
albert#debian:~/wordpress$ sudo cp -a ~/wordpress/* /var/www/html
[sudo] password for albert:
albert#debian:~/wordpress$
However, when I try this (I don't use "sudo" because it's not installed on Debian by default), I get the following error message:
Someone please help me!!!
Thank you so much.
It looks like the wordpress directory is not in the root directory.
Did you cd somewhere after downloading? If not, the wordpress dir should be at your current dir which is /home/lanalee/.
Type in ls to list all files in /home/lanalee/. If the list shows a directory named wordpress, you can continue with the following command:
cp -a ./wordpress/* /var/www/html
I replaced the ~ which points to your systems root directory with a . that refers to the folder your currently in.
If there is no wordpress directory listed, please type ls ~/ and share the output with us.

Workspace Settings permission denied

I'm running Ubuntu 12.04LTS.
Have unpacked Visual Studio Code in a folder owned by my user id. All vscode files are owned by my user id (user and group).
Have Node.js, npm, typescript installed via apt-get (and npm).
Visual Studio code runs fine, however File->Preferences->Workspace Settings gives this error:
Unable to create 'vscode/settings.json' (Error: EACCES: permission denied, mkdir '/.vscode').
Any ideas on how to resolve this? Where is it trying to do the mkdir?
Thanks,
Bob Wirka
UPDATE: Sudo'd mkdir "/.vscode" (literally at the root level), and chown'd it recursively to my user and group. Voila! Now I can edit the settings.
So, is there a way to tell Visual Studio Code that it shouldn't be trying to use the root folder?
Mentioned in the update by the OP but thought I'll mention it explicitly. You need to change the permissions for the folder. The following command will change the owner of the directory so that you can open it without needing root privileges.
$ sudo chown <user-name> -R <directory-name>
I had same issue on my osx. I was able to solve this issue by change the permission to read and write in project folder.
Simply type
sudo chmod 777 -R <your_app_name_directory>.
This will give all permissions to all users, groups and others for read, write, execute.
-R gives recursively permissions to all nested files folders inside your directory.
If -R is not given then it gives permissions to current directory only, not to other directories inside.
Change the permissions to your folder
sudo chmod ugo+rwx your_folder

Access root of drive with a Unix-like shell

I'm using Cygwin to compile a library. The library is not stored within the same directory as Cygwin. I need to navigate to this directory in order to compile the library. The Cygwin shell only allows me to go back as far as the Cygwin root directory using cd .. .
The command su returns the following:
su: user root does not exist
How do I navigate my hard drive using Cygwin if the su command doesn't work?
As suggested by Wooble, the solution is to use the command /cygdrive/ , followed by the drive letter. So, to access the root of the C: drive, type cd /cygdrive/c.

working on lamp server in ubuntu

i m working on ubuntu and just installed lamp.As i m new to linux i m not sure how to create a directory or file under /var/www of lamp server to start working on my website project
Under *nix you can create a directory using mkdir newdirname and you can create a new and empty file, using touch newfilename. Those are commands you need to execute from a shell/terminal. In order to get to /var/www, you will need to cd /var/www.
If you are new to Linux I suggest reading any guide on basic like this or this.
Chances are you do not have sufficient privileges as your normal user to add files or create directories. You can either change the ownership of the /var/www directory (and everything within) or you can sudo each one you want to add.
From the prompt: chown [your_user_name].users -R /var/www
Then you can mkdir [directory name] to make a directory or touch [filename] to create a file.
If you do not change the permissions of the /var/www you may need to put sudo in front of each of the above commands (will be prompted for password)

Resources