I am trying to figure something out as part of something else I am going to do. I was just wondering the easiest and quickest way to run a loop at the Linux command line which will make x amount of symbolic links when I need them.
I am using Debian 5.
I figure its something as easy as ~# foreach statement, then I just do a loop with the command to make a sym link.
How can I restore the data inside the trash after make it empty ?I need to restore an important folder from the trash and I can't find it there.I am using openSUSE11.1 (KDE)
After removing GDM, XFCE4, and the crap-load of dependencies that came with it, something must have gone wrong. I can not place items nor delete items any more. How do I fix this problem of mine? I'm using KDE at the moment.
Code:
Could not make folder /home/theif519/.local/share/Trash
Deletion of files is necessary. I have installed libtrash hoping it'd work, but it didn't, I even did chmod 755 like it suggested I do. What do I do?
I have just accidently deleted /usr/lib as root, how do I restore it from the trash can from command line? Seeing as how no programs will now run. I can't seem to find /root/.Trash, no such folder seems to exist ,or did I just royally screw myself?
Edit:
First off where is the Trash folder for root in Fedora 11 I have googled and looked everywhere I can't get a straight answer. It is not in /root/.Trash for one.
Recently did a fresh install of F12, previously used F11 without any problems. Now Evolution move ALL received messages to trash automatically. I have had to make rules to move each e-mail to the inbox but still all incoming messages go straight to Trash.
I mount /home on a logical partition. Files and directories that I trash from here go nicely into the recycle bin, and I can right click on it and choose "Empty Trash" with no problem. Files off of the root directory in directories that I "own" (i.e. /mydir/*) do not play as nicely. I went ahead and followed instructions from another post, namely:
Code: sudo mkdir /.Trash sudo chmod 1777 /.Trash
And after trashing some files from /mydir, there is indeed a subdirectory with my uid (1000) and files that I trash from /mydir are going in there. However, the recycle bin on my desktop remains empty, and the only method I have for deleting said files is by deleting them from the /.Trash/1000 folders through the command line. So my question is: Is there anyway that I can trash files from /mydir, see them appear on the desktop recycle bin, and empty the trash without the need to rm them directly through the command line? Not sure if it will help, but here is my fstab:
Code: # / was on /dev/sda1 during installation UUID=4129f389-92be-459e-8bbc-928c1440f718 / ext4 errors=remount-ro 0 1 # /home was on /dev/sda6 during installation UUID=6a30914d-04a3-4b03-85bd-2bf16a68a41a /home ext4 defaults 0 2 # swap was on /dev/sda5 during installation UUID=f388cf04-bbd6-4bf9-9d69-0778b0f158fd none swap sw 0 0
When I move something to Trash it doesn't show the option of "Empty Trash". I can use "move to Trash" and it just moving there like some ordinary folder, but shift+del give me an option for deleting the files. Using OpenSUSE 11.3 32bit.
Using Fedora 14 with Gnome 2.3 Desktop utilizing Compiz and Emerald theme manager. When I empty the trash, the icon is still the FULL Trash icon. I tried using different Emerald Themes, and different Icon sets, but still the Trash Icon stays full. I checked the trash folder in $HOME/.local/share/trash and found nothing, no hidden files.
Im writing my first bash script. Its function is to move files to the trash can and write a log file in the same format that the system does to allow for file restoration. The problem is that in bash, everything works fine, but in the OpenBox window session, the files are named after the source directory, not the original name. Heres the script:
Code: #!/bin/bash # trash - Script to move file or folder to the trash can and create a log file ##### Functions ##### err_output () # Writes error message { echo "$0: cannot stat `$1': No such file or directory" echo "USAGE: $0 SOURCE DEST" exit 1 } >&2
if [ -e "${DEST}/${FILE}" ]; then max=0 DIR="$(pwd)" cd "$DEST" shopt -s nullglob for backup in "${FILE}."; do nr=${backup#${FILE}.} if [[ "$nr" =~ ^[0-9]+$ ]]; then if (( nr>max )); then max="$nr" fi fi done cd "$DIR" max=$(( max + 1 )) write_log_numbered mv -- "$SOURCE" "${DEST}/${FILE}.$max" else write_log_unique mv -- "$SOURCE" "$DEST/${FILE}" fi
So I run the script with the test file "Junk". In bash, it moves over and its named correctly. Code: ~/.local/share/Trash/files$ ls file file.1 Files Files.1 Junk The log file is also named correctly
Code: ~/.local/share/Trash/info$ ls file.1.trashinfo Files.1.trashinfo Files.trashinfo file.trashinfo Junk.trashinfo
But, when I go to view the trash can in the file manager in Openbox, the file is called "Testing" which is the name of the source directory. However, if I go to the trashcan via its full path (going to .local/, then share/) all the files are named correctly. Whats going on here? Is there some way to get the trash can to read the correct file name?
I've tried a number of suggestions found on the internet and none of them work. Here's one:Code:mv "$x" ~/.Trash/...where $x is the pathname of the file passed to the script.I've also tried different paths to Trash - on Desktop, in Home folder, in my user folder, it makes no difference. Either nothing happens, or more often, the file is simply copied to my desktop or userfolder with the name "Trash".What is the actual path to the Trash folder and how can I move files there? I'm using Ubuntu 10.04.
I have a problem with a couple of folders in the Trash. If I click on the Trash icon, 2 foldersare there, and when I try to delete them, it just says "Failed to delete the item from the trash"
But when I go to .local/share/Trash there are no files there! Anyway, I tried using the command "sudo rm -rf .local/share/Trash", it shows no error, but the files continue when I click in the trash icon.
I'm looking to make clean up script. I need it to,
Clear ALL Private Data in firefox Clear Recent Doc's Clear Trash Clear Thumbnail folder
I know how to clear the trash from the command line and also the thumbnail folder. I tried to google how to clear firefox but the files to delete seemed to have changed from older versions, they seem to be sqlite files and also I'm unsure which ones to remove. how to clear recent doc's but all the guides seem to be to be for GUI.
I want to gave much details as possible. working directory (~/a1/shell) in the shell directory i have Makefile. also in the shell directory i have subdirectory's (obj, src, include)
My current Makefile
Quote:
#What needs to be built to make all files and dependencies
clean:
# End of Makefile
I wanted it so: all .o files are created in the obj subdirectory, and my application, sshell, is created in the shell directory.
I am getting this error when i run the make run: No rule to make target 'shell.h', needed by 'shutil.o'. stop
$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?
I am doing some embeded linux work in ARM 9263.So I need to make a image for that board.But when I using one command "make uImage" I am getting the following error.
make: arm-linux-gcc: Command not found CHK include/linux/version.h make[1]: `include/asm-arm/mach-types.h' is up to date. CHK include/linux/utsrelease.h HOSTCC scripts/basic/fixdep code....
I am trying to learn how to pass more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
Code: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ${0##*/} [-x] [-g] code....
However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.
This same error occurs if the gnome-terminal line is changed to
Code: gnome-terminal -e mcTerm
Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.
a friend of mine gave me a .tar.gz file which contains a bunch of C sourcefiles and a makefile. I don't get how to use the make command to create an executable out of those files. What arguments do I have to give the make command?
I am trying to grep multiple numbers from file, grep does have the -f option for that.
Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with
Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?
In this link, the last poster describes a way to disable tap click which I find VERY useful, but the thing is, after I reboot it goes away. Is there anyway to make this command permanent?
I cant get my wusb54gc to work I have follow all the instructions from [URL] first tried it on mint and it worked perfect--I installed the latest xubuntu and ran into a problem @: Step 9
Code:
cd /home/user/Downloads/2009_1110_RT3070_Linux_STA_v2.1.2.0
Code:
make && make install
terminal puts out:
Code:
make[1]: Entering directory '/home/ian/Downloads/2009_1110_RT3070_Linux_STA_v2.1.2.0/tools' gcc -g bin2h.c -o bin2h make[1]: gcc: Command not found make[1]: *** [all] Error 127 make [1]: Leaving directory ...same as above make: *** [build_tools] Error 2
then after that step 10 in Xubuntu there is no such directory as /lib/modules/2.6.31-14-generic/updates there is a 2.6.32-21...