recentpopularlog in

kme : filemanagement   120

« earlier  
Inviska Rename
Free open-source batch file rename software for Windows, Mac and Linux
filerenamer  filemanagement  utility  crossplatform  opensource 
june 2019 by kme
GitHub - subogero/rename: Perl rename as a separate package
Perl rename as a separate package. Contribute to subogero/rename development by creating an account on GitHub.
Removes confusion about the util-linux vs Perl versions of rename.

Installs into /usr/local/bin, so it has precedence over your system's default rename.
perl  rename  filemanagement  maybesolution 
may 2019 by kme
bash - Remove files which not named "today.md" - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
Use a negative match (requires shopt -s extglob, but possibly already set):
<code class="language-bash">
rm !(today).md
</code>

(you can first use ls instead of rm to check the result).

Lots of power in extglob, you could also do
<code class="language-bash">
rm !(yesterday|today).md
</code>

if you wanted to spare two files.
bash  shellscripting  wildcard  globs  filemanagement  tipsandtricks 
november 2018 by kme
eradman / treedelta — Bitbucket | https://bitbucket.org/
The td utility makes it easy to see what files were added or removed during the execution of a command. The child process is executed with a pipe that relays a list of files that were provided to td on STDIN. When the child process exits, each unique path is re-scanned and a delta is printed to STDERR.
automation  commandline  cli  differ  diff  filemanagement  utility  software 
october 2018 by kme
ParsingLs - Greg's Wiki | http://mywiki.wooledge.org/
Best explanation came from the BashPitfalls article:
Never try to parse the output of ls. ls is just plain unnecessary. It's an external command whose output is intended specifically to be read by a human, not parsed by a script.
bash  unix  shellscripting  filemanagement  bestpractices  newbie  reference  butwhy 
november 2017 by kme
Get the name of the current file | Vim Tips Wiki | FANDOM powered by Wikia | http://vim.wikia.com/
<code class="language-vim">" given: /abc/def/my.txt
:echo expand('%:p:h:t') " ==> def
" First get the full path with :p (/abc/def/my.txt),
" then get the head of that with :h (/abc/def),
" then get the tail of that with :t (def)</code>
vim  dammitbrain  filemanagement  variables  syntax  fuckina  solution 
november 2017 by kme
GitHub - peterldowns/iterm2-finder-tools: Open iTerm2 from the Finder | https://github.com/
You need to change the (bundled) Automator app to open a new window rather than a tab, if that's what you want by default.

As of 2019-09-05, I had to remove the "try" block and leave behind just the 'set newWindow to (create window with default profile)' so it wasn't trying to open a tab (invisbly) using the drop-down hotkey window.
iterm  finder  automation  hotkey  applescript  filemanagement  fuckina  solution 
november 2017 by kme
"Reveal in Playlist..." action for iTunes · Issue #1008 · quicksilver/Quicksilver · GitHub | https://github.com/
I think the most reliable way is to hit ⌘X in the third pane to clear it out when creating the trigger.
quicksilver  mac  osx  filemanagement  tipsandtricks  solution 
september 2017 by kme
Two separate services (one internal and one not) can be confusing · Issue #409 · quicksilver/Quicksilver · GitHub | https://github.com/
So I've started looking into this, since the ⌘⎋ shortcut doesn't work on the Mac at work. Interestingly enough, this is not the fault of QS, but the fault of the keyboard (?!?). The ⌘⎋ just doesn't seem to work AT ALL. I've installed key codes and when I press ⌘⎋ it doesn't register. All other shortcuts do. This is on 10.7.4, new Mac Mini with an Apple keyboard
(P.S. international English is so annoying. Where's the £ sign?!)

The intersesting thing, however, is that when QS simulates the ⌘⎋ keystrokes using carbon (in QSGlobalSelectionProvider.m invokeService) it does work (this is invoked when you use the 'current selection' object with the 'pull selection from frontmost app' option enabled.

Seeing as there seems to be this huge limitation with ⌘⎋ not actually registering as a keyboard shortcut, here's what I propose:

We remove the 'send to quicksilver' service
We keep the get current selection (internal) service, but rename it to something more obvious so as it isn't changed. e.g. Quicksilver Internal Selection (Private)
We make a new default trigger called 'get selection' that literally just does select current selection in command window. People would be told NOT to touch the ⌘⎋ shortcut in the keyboard preferences (if they do, things will) but to edit the trigger keyboard shortcut.
For those who still like the ⌘⎋ shortcut, and for whom it still works, since it'll still be enabled (as a 'private' service) you can still use that.
Added bonus: Using the current selection proxy works more consistently than the service in Finder (e.g. try the service on a folder in Finder when in column mode) so it should fix a few problems

Once we're down to one service, I'll start working on the few bugs with the 'current selection' proxy :)
quicksilver  hotkey  finder  filemanagement  tipsandtricks 
september 2017 by kme
Issues with Finder Selection (Proxies and Service) · Issue #485 · quicksilver/Quicksilver · GitHub | https://github.com/
Mentioned in IRC, but ⌥⌘G is "Grab 'n' Drop". It's a shortcut for "move the Finder Selection here". Hitting it should result in the interface showing [Finder Selection] ⇥ Move to… ⇥ [Quicksilver Selection], at which point you can hit ↩ to confirm.
quicksilver  hotkey  finder  filemanagement  tipsandtricks 
september 2017 by kme
rename - search.cpan.org
This isn't necessarily the one from Debian (https://www.cyberciti.biz/files/perl/rename.pl.txt), but it's OK, and it has a '--dry-run' option.
sysadmin  filemanagement  perl  rename  maybesolution 
june 2017 by kme
linux - Find the number of files in a directory - Stack Overflow
See also the '-f' option (list unsorted), which avoids some of the extra stat(2) calls.
readdir is not as expensive as you may think. The knack is avoid stat'ing each file, and (optionally) sorting the output of ls.

/bin/ls -1U | wc -l
ls  filemanagement  unix  solution 
march 2016 by kme
Resolved - Finder: drag item to other folder, and... | MacRumors Forums
The behavior *has* changed, however, since Mavericks (relative to 10.11.4). It seems you can no longer press spacebar in "Miller Columns" view to expand one level of hierarchy while dragging. The only way to get this behavior seems to be to enable "Spring-loaded folders," which is in this goofy place in the "Acessibility" prefpane now.
ha! just found 'spring-loaded delay', it's been moved to: System Preferences>Accessibility>Mouse & Trackpad
(if i'd known it was there, i would have tried changing those settings first...)
mac  osx  accessibility  filemanagement  finder  annoyance  elcapitan 
march 2016 by kme
moreutils
On SuSE Linux, you'll have to modify the Makefile to use /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl instead of whatever's in there by default (probably Debian's default location).
bash  sysadmin  cli  commandline  filemanagement  scripting  utility  software 
march 2016 by kme
php - Can I use file_get_contents() to compare two files? - Stack Overflow - http://stackoverflow.com/
function files_are_equal($a, $b)
{
// Check if filesize is different
if(filesize($a) !== filesize($b))
return false;

// Check if content is different
$ah = fopen($a, 'rb');
$bh = fopen($b, 'rb');

$result = true;
while(!feof($ah))
{
if(fread($ah, 8192) != fread($bh, 8192))
{
$result = false;
break;
}
}

fclose($ah);
fclose($bh);

return $result;
}
php  snippet  filemanagement  webdevel  solution 
january 2016 by kme
How can I edit Nautilus Places sidebar and Unity QuickList? - Ask Ubuntu
Excerpts:

gedit ~/.config/user-dirs.dirs

Remove the list you do not want. However, once you login again, it will reset, so

echo "enabled=false" > ~/.config/user-dirs.conf
nautilus  filemanagement  ubuntu  14.04  annoyance  fuckina  solution 
november 2015 by kme
File::Rename - Perl extension for renaming multiple files - metacpan.org
This is the source of the "good" 'rename' script (with the '-n' option).
perl  software  essential  movein  filemanagement  sysadmin 
july 2015 by kme
Moving or rename files and directory using Linux mv command - Basic Linux Command. | Linux Windows Install Setup Configuration Project
Rename Linux files, base on file inode number.

To rename file or directory in Linux using the inode number, we need to know their inode number. Use the ' ls -i ' to find out the inode number for the files or directory.

[root@fedora ~]# ls -i
648389 anaconda-ks.cfg 97315 example-directory 1847716 install.log.syslog
97582 Desktop 1847715 install-fedora.log 648395 X.txt

Now let use the example-directory with inode number 97315 as an experiment for the example.
Now, execute the find command to find the example-directory inode number than rename that directory to new-directory-name.

[root@fedora ~]# find . -inum 97315 -exec mv {} new-directory-name \;
find: ./example-directory: No such file or directory

To verify the change on the directory name, use the ls command with the ' -i ' option to list file and folder including their inode number.

[root@fedora ~]# ls -i
648389 anaconda-ks.cfg 1847715 install-fedora.log 97315 new-directory-name
97582 Desktop 1847716 install.log.syslog 648395 X.txt
inode  linux  filesystem  sysadmin  encoding  illegalcharacters  filemanagement  maybesolution 
july 2015 by kme
Explorer.exe Command-Line Options for Windows 7 - root setting - Microsoft Community
So, cutting through the bullshit, the old options "/e,/root,c:\whatevs" don't work with Win 7 anymore.
win7  explorer  filemanagement  commandlineargs  annoyance 
june 2015 by kme
bash - Preserve directory tree while copying files with cp - Stack Overflow - http://stackoverflow.com/
With rsync:

find ./ -name myFile.txt -print0|rsync -0adv --files-from=- ./ ../newTree/
Without rsync:

You can find all files, for each file you create the directory in the newTree, and copy the file to it.

for file in */myFile.txt; do
dir=$(dirname "$file")
mkdir -p "../newTree/$dir"
cp "$file" "../newTree/$dir"
done
commandline  bash  rsync  filemanagement  solution 
june 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read