cp command should ignore some files

To ignore a git directory specifically, I’d try git export first. But in general, to copy a directory tree excluding certain files or folders, I’d recommend using rsync instead of cp. The syntax is mostly the same, but rsync has way more options, including one to exclude selected files: rsync -rv –exclude=.git demo demo_bkp See … Read more

My fish is blind? (fish does not recognise any commands after setting it as default shell on Mac OS Big Sur, M1 Mac)

Here are the steps I used to setup the fish shell on my M1 MacBook Air. Per the comments on the question, the key to solving the Unknown Command issue is the fish_add_path: $ brew install fish ​ $ fish $ fish_add_path /opt/homebrew/bin $ echo “/opt/homebrew/bin/fish” | sudo tee -a /etc/shells $ chsh -s /opt/homebrew/bin/fish

Read first x lines of csv file into new outfile?

Brief (You’ll use a linux terminal/console) Use head -n NUMBEROFLINES file.csv to get the first NUMBEROFLINES of lines. Write it into another file using shell redirection (>) like this: head -n NUMBEROFLINES file.csv > mynewfile.csv Note that this will totally recreate mynewfile.csv, if it had any content before it is now deleted forever(-ish). If you … Read more

ANSI Coloring in Compilation Mode

There’s already a function for applying color to comint buffers. You simply need to enable it on compilation buffers: (require ‘ansi-color) (defun colorize-compilation-buffer () (toggle-read-only) (ansi-color-apply-on-region compilation-filter-start (point)) (toggle-read-only)) (add-hook ‘compilation-filter-hook ‘colorize-compilation-buffer) Color writing programs should check the TERM environment variable and the terminfo database to check if the terminal supports color. In practice, a … Read more