ops102:file_globbing_common_commands_and_text_editors
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ops102:file_globbing_common_commands_and_text_editors [2024/01/17 05:32] – created chris | ops102:file_globbing_common_commands_and_text_editors [2024/05/24 19:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 14: | Line 14: | ||
|*|Matches zero or more characters|Matches zero or more characters| | |*|Matches zero or more characters|Matches zero or more characters| | ||
|?|Matches one character|Matches one character, unless at the end of the filename or immediately before the dot preceeding the extension | |?|Matches one character|Matches one character, unless at the end of the filename or immediately before the dot preceeding the extension | ||
- | |< | + | |< |
Line 20: | Line 20: | ||
^Pattern^Matches on Linux^Does not match on Linux^Matches on Windows^Does not match on Windows^ | ^Pattern^Matches on Linux^Does not match on Linux^Matches on Windows^Does not match on Windows^ | ||
+ | |*.html|first.html blue.html|RED.HTML purple.htm|Blue.html blue.html RED.HTML|purple.htm| | ||
|a*|a aa aaa alpha argonaut|Alpha banana|a aa aaa alpha Alpha|banana| | |a*|a aa aaa alpha argonaut|Alpha banana|a aa aaa alpha Alpha|banana| | ||
|b*e|blue bite|red green blot|blue bite|red green blot| | |b*e|blue bite|red green blot|blue bite|red green blot| | ||
- | |c[[oa]]t|cat cot|coat| |cat cot coat //(Not applicable)// | + | |c< |
|d?e|due doe|duo Doe date|due doe Doe|duo date| | |d?e|due doe|duo Doe date|due doe Doe|duo date| | ||
|a??|aaa abc|aa abcd|aaa abc aa|abcd| | |a??|aaa abc|aa abcd|aaa abc aa|abcd| | ||
Line 36: | Line 37: | ||
rm *.pdf</ | rm *.pdf</ | ||
- | on Linux will remove all files with the extension '' | + | on Linux will remove all files in the current directory that have the extension '' |
- | ===== Common | + | You can combine absolute, relative, or relative-to-home pathnames with patterns. For example, in the command: |
+ | |||
+ | < | ||
+ | del \Users\jdoe\Documents\*.txt</ | ||
+ | |||
+ | The pattern '' | ||
+ | |||
+ | On Linux, you can also use patterns to match directory names: | ||
+ | |||
+ | < | ||
+ | rm / | ||
+ | |||
+ | This will delete any files named '' | ||
+ | |||
+ | ===== Common | ||
Here are some basic commands useful for managing the filesystem and performing basic tasks: | Here are some basic commands useful for managing the filesystem and performing basic tasks: | ||
^ Linux ^ Windows ^ Description ^ | ^ Linux ^ Windows ^ Description ^ | ||
- | |ls|dir|Displays | + | |ls|dir|Lists the contents of a directory -- by default, the current directory, or the directories specified as arguments (or a specific file, if specified).| |
|echo|echo|Places a message on the screen (the message is given as positional arguments)| | |echo|echo|Places a message on the screen (the message is given as positional arguments)| | ||
|cal| |Displays a simple calendar| | |cal| |Displays a simple calendar| | ||
- | |date|date /t<br />time /t|Displays | + | |date|date /t\\ time /t|Tells you the current date (or date/time)| |
|who|quser|Displays information about the logged in user(s)| | |who|quser|Displays information about the logged in user(s)| | ||
|whoami|whoami|Displays the name of the current user| | |whoami|whoami|Displays the name of the current user| | ||
- | |clear|cls|Clears the terminal | + | |clear|cls|Clears the screen (terminal). Note: in the Bash shell, you can also clear the screen during command entry by typing Ctrl+L| |
- | |tree|tree|Displays the filesystem hierarchy starting at the current directory (or the given directory, if an argument is provided).| | + | |tree|tree|Displays |
- | |mkdir|mkdir|Creates | + | |mkdir|mkdir|Make a directory/ |
- | |rmdir|rmdir|Removes | + | |rmdir|rmdir|Remove |
|rm|del|Removes/ | |rm|del|Removes/ | ||
+ | | |X:|(Where X is a drive letter) Switches to the selected drive.| | ||
|cd|cd|Changes to the given directory, if one is given. If no directory is given, displays the current directory (Windows) or changes to your home directory (Linux). On Windows, a drive designator may be provided, in which case the current directory will be set on the indicated drive.| | |cd|cd|Changes to the given directory, if one is given. If no directory is given, displays the current directory (Windows) or changes to your home directory (Linux). On Windows, a drive designator may be provided, in which case the current directory will be set on the indicated drive.| | ||
- | | |X:|(Where X is a drive designator) Switches to the selected drive.| | + | |pwd|cd|Prints the current working directory.| |
- | |pwd| |Prints the current working directory.| | + | |
|cp|copy|Copy one or more files to a new name/ | |cp|copy|Copy one or more files to a new name/ | ||
|mv|move|Moves a file from one directory to another.| | |mv|move|Moves a file from one directory to another.| | ||
- | |mv|ren<br>rename|Renames a file (on Linux, the filename and location are considered to be the same thing)| | + | |mv|ren\\ rename|Renames a file (on Linux, the filename and location are considered to be the same thing)| |
|cat|type|Dumps the contents of a text file on the terminal (if there is a lot of text, the display will scroll; if the file is a non-text file, the results are undefined!)| | |cat|type|Dumps the contents of a text file on the terminal (if there is a lot of text, the display will scroll; if the file is a non-text file, the results are undefined!)| | ||
- | |more<br>less|more|Displays a file one screen at a time. (Linux: the less command is a more powerful version of the '' | + | |more\\ less|more|Displays a file one screen at a time. (Linux: the less command is a more powerful version of the '' |
|cut| |Selects specific columns from a text file| | |cut| |Selects specific columns from a text file| | ||
|sort|sort|Sorts a text file| | |sort|sort|Sorts a text file| | ||
- | |diff|comp<br/>fc|Shows the differences between (text) files| | + | |diff|comp\\ fc|Shows the differences between (text) files| |
|uniq| |Displays identical consequtive lines only once| | |uniq| |Displays identical consequtive lines only once| | ||
|tr| |Translates/ | |tr| |Translates/ | ||
Line 74: | Line 89: | ||
===== Viewing Online Documentation | ===== Viewing Online Documentation | ||
- | To find a Linux command to perform a particular function, use the '' | + | To find a Linux command to perform a particular function, use the '' |
- | < | + | '' |
- | | + | |
- | | + | |
To view information about a Linux command, use the online manual (" | To view information about a Linux command, use the online manual (" | ||
- | < | + | '' |
- | man // | + | |
For example, to view the online manual page for '' | For example, to view the online manual page for '' | ||
- | < | + | '' |
- | man cp</ | + | |
On Windows, you can see a list of commonly used commands by typing | On Windows, you can see a list of commonly used commands by typing | ||
- | < | + | '' |
- | help</ | + | |
To view information about a Windows command, use the online help: | To view information about a Windows command, use the online help: | ||
- | < | + | '' |
- | help // | + | |
For example, to view the online help for '' | For example, to view the online help for '' | ||
- | < | + | '' |
- | help dir</ | + | |
Alternately, | Alternately, | ||
- | < | + | '' |
- | copy /?</ | + | |
===== Text Editors | ===== Text Editors | ||
Line 114: | Line 121: | ||
It's often necessary to edit a text file containing a script, program, data, or configuration information. There are many text editors available. | It's often necessary to edit a text file containing a script, program, data, or configuration information. There are many text editors available. | ||
- | On Linux systems, most distributions (the organizations or companies responsible for maintaining and distributing the system) have standardized on the '' | + | ==== Default Text Editors ==== |
- | < | + | It is often useful to learn how to use the text editor(s) provided by default with each operating system, because these editors will be available on almost any computer you use without installing any additional software. |
- | nano | + | |
- | nano //file//</ | + | === Linux Default Text Editor === |
+ | |||
+ | On Linux systems, most distributions (the organizations or companies responsible for maintaining and distributing the system) have standardized on the '' | ||
+ | |||
+ | '' | ||
Nano provides a help display at the bottom of the screen. The carat '' | Nano provides a help display at the bottom of the screen. The carat '' | ||
- | The current versions of Windows (Windows 10 & 11) do not provide | + | Since Linux systems |
- | < | + | === Windows Default Text Editor === |
- | | + | |
- | notepad //file//</code> | + | The current versions of Windows (Windows 10 & 11) do not provide a CLI/TUI text editor (previous versions of Windows did provide a CLI text editor, and there is a current discussion about ading this back in). However, you can run the GUI Notepad editor, either from the Start Menu, or from the command line (as long as you are not accessing the Windows system remotely through a non-graphical connection): |
+ | |||
+ | '' | ||
+ | | ||
+ | |||
+ | ==== Other Text Editors ==== | ||
+ | |||
+ | There are **many** other text editors available for both platforms, and many editors are available that work on multiple operating systems. | ||
+ | |||
+ | There are also several categories of software that are (arguably) a type of text editor, including: | ||
+ | * Basic text editors | ||
+ | * Code editors, for editing software and configuration files, with features such as tooltip help, syntax highlighting, | ||
+ | * Word processors, for editing documents, with features such as spell checking, visual formatting, advanced layout features such as columns and tables | ||
+ | |||
+ | Software developers and system administrators have strong opinions about their tools, and particularly about their text editors. Things to consider when selecting any type of text editor include: | ||
+ | * Interface: does the editor use a graphical user interface, a text user interface, or can it operate in both modes? | ||
+ | * Tools: does the editor have useful tools such as syntax highlighting for common languages and configuration files? Does the list of supported languages include the ones you want to use? | ||
+ | * Visual complexity: some users prefer an editor with on-screen controls (or help) for most or all of the actions they may perform so that they can access these features quickly. Others prefer a less-cluttered screen which dedicates maximum screen space to content and minimizes distractions. | ||
+ | * Previews and integration with other tools: can the software provide visual previews, such as HTML and CSS display for web documents, LaTeX rendering, and accessibility assessments? | ||
+ | * Feature control: can you easily turn features on and off? For example, can you disable spell checking or syntax highlighting if your file contains a section that is in a different language? Can you disable auto-correction when it is not relevant to the project at hand? | ||
+ | |||
+ | Most software developers and system administrators use multiple editors for different tasks - for example, they may choose one editor for quick cnfiguration changes, another editor (or IDE) for larger development tasks, and multiple editors for different types of documentation. | ||
+ | |||
+ | Note that features intended for one editing task can be a nuscience in another context. For example, a word processor will often convert double quote characters into “smart quotes” (look closely at the quotation characters in this line), where the opening and closing quote characters are distinct characters. While these look great and are good for general writing, they are problematic in code and in examples that may appear in documentation, | ||
ops102/file_globbing_common_commands_and_text_editors.1705469551.txt.gz · Last modified: 2024/04/16 18:10 (external edit)