General :: Removing Path Prefix From Filesnames?
Jun 9, 2011I have a text file containing file names with their paths prefixed as in:
/path1/file1.dat
/path2/file2.dat
and so on.
code]...
I have a text file containing file names with their paths prefixed as in:
/path1/file1.dat
/path2/file2.dat
and so on.
code]...
I really missed the old Ubuntu file/dir. copying feature. When I copied in nautilus file explorer and paste into a terminal or text editor, I got the exact path (eg. /home/user/abc.txt), but when coming the Ubuntu 10.04, it added some "file://" prefix to the actual path (eg. file:///home/user/abc.txt), and I always had to manually delete the "file://" prefix. I don't see clearly that we need to place "file://" in front of the actual path (maybe just in the case we want to put the path in an Internet browser?). Wish this reversed back.
View 1 Replies View RelatedI found the following function in /etc/profile file.
[Code]...
1. I dont undestand what "if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)"" this if statement actually comapres??
2. Also what is the difference between PATH=$PATH:$1 & PATH=$1:$PATH
've googled first - but why is this in front of my username? (and dir) I have never seen it before but am new to terminal and want to learn.I am trying to rm the .Trash (some locked crap) sudo rm -rf /* isn't working and this weird 'prefix' is in front of every directory. Have I hosed it
View 7 Replies View RelatedI use this command:
Code:
find ./ -atime +360
to figure out the files that haven't been accessed since 360 days. The command above will return results like this:
Code:
/uploads/2010/02/some-file-name.ext
/uploads/2009/08/another-file-name.ext
... etc
I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:
Code:
mv /uploads/2010/02/some-file-name.ext /old-files/uploads/2010/02/some-file-name.ext
But I want the executed command to create this path
Code:
/old-files/uploads/2010/02/
If it doesn't exist.
I have a program that takes a relative path as input appends it to a some path string to get the actual path.
Now all I can input is the relative path. So if I want to go one level above my input will be ../mypath.
If I know the depth of the path used internally, I can use .. as many times to go to the root directory and then give the absolute path. But suppose I do not know the depth of the directory, can I construct a relative path string such that it considers it as a relative path. One way could be to have enough .. in the path string so that I can force an absolute path for some maximum depth of path.
Is there some path string syntax that I am not aware of but can achieve this?
Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.
View 3 Replies View RelatedI have a path c:windowsackup I need this string to be changed into /windows/back/up I used the command -bash-3.00$ echo windackup | sed 's/\//g' but the output is windbackup
View 7 Replies View RelatedCurrent script:-
prefix=user@my-server:
find . -depth -type d -name .git -printf '%h�' | while read -d "" path ; do (
cd "$path" || exit $?
[code]....
How shall i go about changing the absolute path to relative path, so that /home/git/mirror/android/adb/ndk.git gets converted to /mirror/android/adb/ndk.git //echo <command> "$prefix$PWD.git" ?? - anything for relative path?
I have a very large directory with probably millions of small files in it. It's taking forever to run ls on the directory.
Is there an easy script that I can run to split the directory into smaller ones, based on the prefixes of the filenames. My goal is to wind up with something similar to what the Debian archives' pool directory looks like.
I want to rename files in multiple subfolders with a prefix (e.g., rename "file.tif" with "prefix_file.tif") and not have to be in the subfolder.
code: for f in /path/to/*; do echo mv "$f" "PRE_$f"; done
gives you this: mv /path/to/file1 PRE_/path/to/file1
instead I want this: mv /path/to/file1 /path/to/PRE_file1
have a gzip file ABC_000023232.gzipBCD_023232032.gzipI want to split these files into smaller files but keep the extension same because I am using this as a variable in a script
Code:
for i in `ls *.gzip`
split -b 500K $i $i
[code]...
kernel 2.6.21.5, slackware 12.0
GNU bash 3.1.17
Code:
As you can see, /usr/local/bin is in the path. However, bash does not look for nasm in /usr/local/bin.
If I am root, things go well:
Code:
I know a bunch of commands and I am comfortable using the terminal, I even set a powerpc server but I can't figure out how to remove epiphany on this new computer I'm setting up. I didn't install anything with tasksel. I installed gnome and xorg afterwards... I load it up and 'startx' just fine. then I check around for the programs that were installed. I lik'em gimp, lot's of utilities. gedit. anyway I find epiphany, which I have already established that I dislike, I immediately go to the root terminal (another nice program that comes with gnome) and type apt-get remove epiphany-browser-data the output says it will be deleting gnome... however I have researched and found these are simpy meta packages that don't really matter.... however under the section that states all the packages that will be removed by autoremove there is a huge list... I doubt these packages are safe to remove. how to remove epiphany without removing a huge amount of probably needed software
View 14 Replies View Relatedwhat i did was, remove evolution mail from synaptic, what i wanted to do was just remove the indicator applet from the task bar. i read a bunch of bad stuff about removing evolution from synaptic vs just removing the applet.
im worried. did i break anything or put my security at risk. after, i used a command (older) (sudo apt-get install ubuntu-desktop)to install ubuntu desktop. because i thought that it would fix evolution. then i went to synaptic and installed a package called evolution. i rechecked evolution in applications menu. however, i notice that i have both a checkable evolution and two evolution icons. nothing 'seems' broken. im not sure if it ever was. and evolution calender pops up as normal, as does the the installed plain evolution. they both seems to be an exact copy of the other.
all i really wanted to do was remove the indicator applet. did i make a serious mistake. since ive had ubuntu, ive reformatted a lot because i was worried i made a mistake of some kind. however now im into the more "make a mistake and fix it stage' as im pretty happy with my current desktop and have worked hard to customize it. the command, sudo apt-get remove indicator-messages removed the mail icon. i still am worried that i broke something, or put my security at risk. also, now i have two mail icons. evolution mail and calendar, and another just called evolution.
Java applet not loading image with relative path(e.g. images/1.jpg) but loads image with absolute path(i.e. from /root/user/images/1.jpg) . This is a problem when i want to host the applet on web server
View 2 Replies View RelatedI've got a /64 range on my vps and would like to add them all so i can use them currently i'm adding them like: ifconfig eth0 inet6 add ipv6ip/64.Is there a way to add all of them in the prefix at once??
View 1 Replies View RelatedThese should be my last pleas for help with regard to Fedora 13. I've been unable to turn off the notifications that appear in the top right corner, despite a decent amount of searching on google. I can't remove any notifications package without removing a bunch of important software along with it. Also, F13 refuses to "Safely Remove" either of my external disks. I have to yank out the usb cord, touching wood each time.
View 5 Replies View RelatedUbuntu was working perfect for 3 months or more , but now all of a sudden after I restarted because I had massive lag, I found that I can no longer open Ubuntu.The error I get is "NTFS5 Prefix not set".Now I get black terminal when I open ubuntu.
View 3 Replies View Relatedhow to add a path to PATH variable permanently so that it remains persisent even after closing shell and rebooting the system when i added a path, to variable it remained there as long as i didn't closed the shell. but when i reopened it ,changed were undone.
View 2 Replies View RelatedI have a list of numbers I want to add a prefix number to the front of all of them,Is this possible with terminal, example "222222" put "1111" in front make the number "111122222" I have the list of 2222etc but not a list of 1111.
View 5 Replies View RelatedI'm tryieng to install some software which requares php. I typed: Code: ./configure --with-php=/usr/include/php But in the end of configuration I get this warning: Code: configure: WARNING: unrecognized options: --with-php on Ubuntu systems it is okEverything installs ok. But on fedora I can not configure my software with php
View 3 Replies View RelatedI'm writing a application which uses translates and I wonder how to check what has been prefix of it's installation to check where translation files are stored. I'm using cmake so maybe is there some preprocessor definition of installation prefix
View 4 Replies View Relatedin LQ, what the 'g' in names like gzip, gawk means, becauseassumed the incorrect meaning.Cf. zip, awk. I have now forgotten. An easy answer would be: GNU. Perhaps it's the correct one
View 8 Replies View RelatedI am trying to figure out how i can add the path /usr/sbin/ into the $PATH variable. I want this to be used from the normal account. I am bored settinh this manualy each time my computer starts.
View 2 Replies View RelatedI want to add suffix or prefix in all files (.txt , .avi . , .exe)from a folder
View 9 Replies View RelatedI have rebuilded some packages from source to enable some features not in place by default. I usually use /usr/local as prefix for rebuilded packages.Now I have a problem building some other applications. Make exits with error saying that there is no .la file for some libraries from rebuilded packages - and it tries to find this file with /usr prefix, not /usr/local.Of course, I can place link to .la file I need under /usr prefix, but this is not good. Is there any way to make system search for .la files under right prefix (which is right in .pc files for packages too, of course)?
View 3 Replies View RelatedI ran into this bug: [URL]...I checked that overwrite-local was set to 1. So I want to delete all python packages that were installed by checkinstall with the /usr prefix.
Now it has been some time since I did this and I dont really remember. Does anyone using checkinstall know how to spot packages installed via checkinstall? I already checked the FAQ and doc of checkinstall, but no info on this.
I ran 'sudo apt-get install python', which completed successfully. According to [URL] this should have created the directory /usr/lib/python2.6, but I do not see any such directory.This is causing problems:
$ python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
[code]....
I've tried 'apt-get purge python' and then reinstalling but this has not resolved the issue.
I have used avidemux to cut a mp4 file, choosing just a part of it, and I have discovered it automatically adds "avidemux" to the beginning of the name of the file, plus the author of the file and that I cannot edit the file to erase it. Note that I talk about "right click - properties", and that the file, as seen from home folder dont include the "avidemux" prefix, but if, for instance, I run the file with VLC, "avidemux" will appear, and that is annoying. how to delete that annoying avidemux prefix?
View 1 Replies View Related