save a file with exist file name by mistake in Ubuntu
location: linuxexchange.com - date: April 30, 2015
I have a .cpp file named "LocalMap.cpp" in my folder in Ubuntu OS 14.04, then I saved another file named "LocalMap.cpp" with gedit in the same folder by mistake. So the last file content missing, and it's not in the Trash.
Is that possible to find the last file?
Thanks for your help.
How to only get file name with linux `find`?
location: linuxexchange.com - date: July 1, 2014
I'm using find to all files in directory, so I get a list of paths. However, I need only file names. i.e. I get ./dir1/dir2/file.txt and I want to get file.txt
How do I know the script file name in a Bash script?
location: linuxexchange.com - date: December 21, 2013
How can I determine the name of the Bash script file inside the script itself?
Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?
wget: downloaded file name
location: linuxexchange.com - date: December 20, 2011
I'm writing a script for bash and I need to get the name of the downloaded file using wget and put the name into $string
for example if I downloading this file below, I want to put it's name mxKL17DdgUhcr.jpg to $string
wget http://pics.sitename.com/images/191211/mxKL17DdgUhcr.jpg
45439 (44K) [image/jpeg]
Saving to: «mxKL17DdgUhcr.jpg»
100%[===================================================================================================>] 45 439 --.-K/s в 0s
2011-12-20 12:25:33 (388 MB/s) - «mxKL17DdgUhcr.jpg» saved [45439/45439]
add a new file in existing RPM
location: linuxexchange.com - date: April 17, 2015
I am modifying gnome-shell-3.8.xx.rpm package. I have created several patches for rpm and they are working fine.
Now I want to add new source file in rpm but I am not able to find how to do it?
For patches I have followed below approach:
Download source rpm.
install rpm which creates BUILD, BUILDROOT, RPMS, SOURCES SPECES SRPMS directories.
copy my patches in SOURCES directory.
Modify the SPEC file to include my patches
Create new package with rpmbuild -bb SPEC/spec_file command.
stat() error 'No such file or directory' when file name is returned by readdir()
location: linuxexchange.com - date: December 24, 2014
I'm not able to identify the error thrown by stat. The below program reads all files in a directory and prints the file name:
DIR *dp;
struct dirent *dirp;
struct stat sb;
if((dp = opendir(argv[1]))==NULL)
{
perror("can't open dir");
}
while((dirp = readdir(dp))!=NULL)
{
if (stat(dirp->d_name, &sb) == -1) {
perror("stat");
}
printf("File name: %s \n",dirp->d_name);
}
Sample output:
/home/eipe
stat error: No such file or directory
File name: copyofsample
File name: a.out
File name: .
stat error: No such file or directory
File name: udpclient.c
File name: ..
stat error: No such file or directory
File name: client.c
stat error: No such file or directory
File name: ftpclient.c
Here are the contents:
ls -l /home/eipe/c
-rwxr-xr-x 1 eipe egroup 7751 2011-02-24 15:18 a.out
-rw-r--r-- 1 eipe egroup 798 2011-02-24 13:50 client.c
-r
Colon (:) appears as forward slash (/) when creating file name
location: linuxexchange.com - date: November 9, 2012
I am using date and time to label a new file that I'm creating, but when I view the file, the colon is a forward slash. I am developing on a Mac using 10.7+
Here is the code I'm using:
File.open("#{time.hour} : 00, #{time.month}-#{time.day}-#{time.year}", "a") do |mFile|
mFile.syswrite("#{pKey} - #{tKey}: \n")
mFile.syswrite("Items closed: #{itemsClosed} | Total items: #{totalItems} | Percent closed: % #{pClosed} \n")
mFile.syswrite("\n")
mFile.close
end
Here is the output (assuming the time is 1pm):
13 / 00, 11-8-2012
Why is this happening and how can I fix it? I want the output to be:
13:00, 11-8-2012
Change title of mp3 in id3 tags to the file name
location: linuxexchange.com - date: October 26, 2010
I have hundreds of mp3 files that have unique file names in succession. i.e. mysong8001.mp3 and mysong8002.mp3 and mysong8101.mp3 where "80" and "81" are the year and "01" and "02" reflect the order of the files for a given year.
The person that created the files did not add any tags except for a Title. Unfortunately all of the files for 1980 have the Title "1980" and all of 1981 have the Title "1981". Once imported into iTunes, there is no way to distinguish the files or their order.
Is there a way to change the id3 tag info for the Title to be the same as the file name? So that in iTunes, the Title would be "mysong8001"? I would prefer to change this for all files in a directory rather than me having to open each file's info and manually change it. That would take days to weeks to accomplish.
One other thing that would be nice is that as a group of files, that I could also change other tags as well that would be common to all of them like the "Artist", "Album", etc.
Any sugge
How to get “wc l” to print just the number of lines without file name?
location: linuxexchange.com - date: December 22, 2014
wc -l file.txt
outputs number of lines and file name.
I need just the number itself (not the file name).
I can do this
wc -l file.txt | awk '{print $1}'
But maybe there is a better way?
error 1325 <username> is not a valid short File Name
location: linuxexchange.com - date: May 30, 2012
While trying to install *.msi or file on a windows 7 operating system I got the following error:
error 1325 <username> is not a valid short File Name
How can I fix this issue so the install will go through?
please wait...
Page: 1 2 3 4 5 6 7 8 9 10