Eza: आधुनिक और मेंटेन किया जाने वाला ls विकल्प
(github.com/eza-community)- eza Unix/Linux के file listing command
lsका आधुनिक CLI विकल्प है, जिसका लक्ष्य ज़्यादा फीचर्स और बेहतर defaults देना है - यह file types और metadata को रंगों से अलग दिखाता है, symbolic links, extended attributes और Git जानकारी को पहचानता है, और छोटे व तेज़ single binary के रूप में उपलब्ध है
- मौजूदा
exaकी तुलना में इसमें Grid Bug fix, hyperlinks, mount point details, SELinux context, Git repository status, human-readable relative dates, security fixes,brightterminal colors औरtheme.ymlconfiguration जोड़े गए हैं - इसे Windows, macOS और Linux पर install किया जा सकता है, और Nix flake environment में
nix run github:eza-community/ezaसे build करके run किया जा सकता है - इसका options system
lsजैसा पूरी तरह नहीं है, और display, filtering, long listing व theme settings के ज़रिए file listing output को बारीकी से adjust किया जा सकता है
eza द्वारा दिया जाने वाला ls विकल्प अनुभव
- eza Unix और Linux operating systems में शामिल पुराने file listing command
lsका आधुनिक विकल्प है - मूल लक्ष्य
lsसे ज़्यादा feature-rich और user-friendly version देना है - यह file types और metadata को रंगों से अलग दिखाता है
- यह symbolic links, extended attributes और Git जानकारी को पहचानता है
- यह छोटा, तेज़ है और single binary के रूप में उपलब्ध है
exa की तुलना में जोड़े गए फीचर्स
- eza में
exaमें न मौजूद कई फीचर्स शामिल हैंexa2021 में आए “The Grid Bug” का fix- hyperlink support
- mount point details output
- SELinux context output
- Git repository status output
- human-readable relative dates
- कई security fixes
brightterminal colors support- छोटे bug fixes और changes
- colors और icons customize करने के लिए
theme.ymlconfiguration file
चलाना और install करना
- Nix flake support वाले environment में आप निम्न command से eza try कर सकते हैं
nix run github:eza-community/eza
- Nix eza को build करने के बाद run करता है
- arguments pass करने के लिए नीचे की तरह
--के बाद options जोड़ेंnix run github:eza-community/eza -- -ol
- eza Windows, macOS और Linux पर उपलब्ध है
- platform और distribution के हिसाब से installation methods INSTALL.md में हैं
command-line options की संरचना
- eza के options लगभग
lsजैसे हैं, लेकिन पूरी तरह समान नहीं हैं -
display options
-1,--oneline: एक line में एक item दिखाएं-G,--grid: items को grid में दिखाएं; यह default है-l,--long: विस्तृत details और attributes दिखाएं-R,--recurse: directories को recursively explore करें-T,--tree: directories को tree form में recursively दिखाएं-F,--classify=(when): file name के पास type indicator output करें--colour=(when),--color=(when): terminal colors कब use करने हैं, यह specify करें--icons=(when): icons कब दिखाने हैं, यह specify करें--hyperlink=(when): items को hyperlink के रूप में कब दिखाना है, यह specify करें--absolute=(mode): items के absolute path को दिखाने का तरीका specify करें
-
filtering options
-a,--all: hidden files और dot files दिखाएं-d,--treat-dirs-as-files: directories को normal files की तरह list करें-L,--level=(depth): recursion depth limit करें-s,--sort=(field): sort field specify करें--group-directories-first: directories को पहले दिखाएं--group-directories-last: directories को बाद में दिखाएं-D,--only-dirs: सिर्फ directories दिखाएं-f,--only-files: सिर्फ files दिखाएं--git-ignore:.gitignoreमें मौजूद files ignore करें-I,--ignore-glob=(globs): pipe से अलग किए गए glob patterns वाली files ignore करें--allदो बार pass करने पर.और..directories भी दिखती हैं
long listing और Git संबंधित जानकारी
--longया-luse करने पर long listing options इस्तेमाल किए जा सकते हैं- file size और permissions से जुड़े options उपलब्ध हैं
-b,--binary: binary prefixes के साथ file size दिखाएं-B,--bytes: prefix के बिना bytes में file size दिखाएं-o,--octal-permissions: permissions को octal format में दिखाएं--no-permissions,--no-filesize,--no-user,--no-time: संबंधित fields का output suppress करें
- file system और metadata से जुड़े options उपलब्ध हैं
-H,--links: hard links की संख्या दिखाएं-i,--inode: inode number दिखाएं-M,--mounts: mount details दिखाएं; केवल Linux और macOS पर उपलब्ध-Z,--context: security context दिखाएं-@,--extended: extended attributes और size दिखाएं--total-size: recursive directory size दिखाएं
- Git संबंधित output भी support है
--git: हर tracked या ignored file का Git status दिखाएं--git-repos: हर tracked directory का Git status दिखाएं--git-repos-no-status: सिर्फ यह दिखाएं कि directory Git repository है या नहीं; यह तेज़ है--no-git:--git,--git-repos,--git-repos-no-statusको हमेशा ignore करता है और Git status output suppress करता है
- time format
default,iso,long-iso,full-iso,relative, या+<FORMAT>के रूप में custom format support करता है- उदाहरण:
+%Y-%m-%d %H:%M2023-09-30 13:00format में output देता है - detailed format strings के लिए
eza(1)manual page और chrono documentation देखें
- उदाहरण:
- manual pages repository की man directory में देखे जा सकते हैं, और version
[0.18.13] - 2024-04-25से terminal मेंman ezaके रूप में भी उपलब्ध हैं
theme customization
- eza ने हाल ही में
theme.ymlfile support जोड़ा है theme.ymlमें वे existing theme options specify किए जा सकते हैं जोLS_COLORSऔरEXA_COLORSenvironment variables में use किए जा सकते थे- file types और extensions के हिसाब से अलग icons specify करने का option भी उपलब्ध है
- अगर existing environment variables set हैं, तो backward compatibility के लिए वे continue work करते हैं और priority लेते हैं
- pre-made themes official eza-themes repository में देखे जा सकते हैं या आप खुद contribute कर सकते हैं
- example theme file
docs/theme.ymlमें है - theme file को
EZA_CONFIG_DIRenvironment variable से specified directory में रखें, या default रूप से इसे$XDG_CONFIG_HOME/ezaमें खोजा जाता है - details eza_colors-explanation.5.md और docs/theme.yml में हैं
contribution
- eza में contribute करने के लिए code of conduct का पालन करना होगा
- actual development participation की जानकारी CONTRIBUTING.md में है
1 टिप्पणियां
Hacker News की राय
डायरेक्टरी लिस्टिंग में इंसानों के पढ़ने लायक तारीखें खास तौर पर खटकती हैं
मैं वह चीज़ ढूंढ रहा हूं जिसे कल सुबह करीब 11 बजे किसी फ़ोल्डर में कॉपी किया था, और अगर सब कुछ “1 day ago” दिखे तो उससे मदद नहीं मिलती। तारीख और समय चाहिए, और HN जैसे फ़ोरमों में भी यही होना चाहिए: पहले सटीक तारीख/समय दिखाएं, फिर ज़रूरत हो तो साथ में “7 hours ago” जोड़ दें
समझ नहीं आता कि जानकारी जानबूझकर क्यों हटाई जाती है, और सोचता हूं कि क्या यह infinite scroll जैसे फ्लो का नतीजा है
HTML लिखते समय मैं इसे हमेशा इस्तेमाल करने की कोशिश करता हूं
(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ti...)
अगर आपको याद है कि कोई खास तारीख दोस्त के जन्मदिन के अगले दिन थी और आप कोई item ढूंढना चाहते हैं, लेकिन डिस्प्ले सिर्फ “three months ago” है, तो आपको पूरे एक महीने का डेटा खंगालना पड़ेगा
पहले detailed time दें, और चाहें तो साथ में “कुछ दिन पहले” वाला डिस्प्ले भी दे दें
lsdभी है, लेकिन फिर भी मैं eza को ज़्यादा पसंद करता हूंजिन लोगों की रुचि हो, उनके लिए आजकल पुराने टूल्स की जगह इस्तेमाल होने वाले कुछ modern command-line tools हैं:
batsyntax highlighting वालाcatहै,difftasticबेहतरdiffहै,gduSSD के लिएncduहै,zoxidemoderncdहै,fdfindका विकल्प है,rgripgrepहै,fzffuzzy finder है,jlessmouse folding वाला JSON viewer है,drarelease assets download/install करता है,lazygitGit TUI है,lazydockerDocker TUI है,yaziimage preview वाला file manager है,zellijबेहतरtmux/screenहै, औरstarshipकई shells में इस्तेमाल होने वाला prompt configuration tool हैtaskMakefile का विकल्प है,hyperfinebenchmark tool है,vegetaload testing tool है, औरsdबेहतर व अधिक सहजsedहैJSON की तिकड़ी भी है:
jqमशहूर JSON processor है,jcकई CLI tools के output को JSON में बदलता है, औरgronJSON कोgrepकरना आसान बनाता हैfdऔरrgके बारे में सावधान रहना चाहिए कि ये default रूप से.gitignoreमें शामिल items को ignore करते हैं। अगर इन्हें सिर्फfindका सीधा replacement समझें, तो चौंक सकते हैं। संबंधित चर्चा [0] में हैऐसे tools recommend करते समय यह बात साफ़ बतानी चाहिए। docs न पढ़ें तो यह आसानी से छूट जाती है। निजी तौर पर, मैं चाहूंगा कि ऐसे replacement coreutils टूल्स अपने defaults को मूल tool के ज़्यादा करीब रखें। अगर इसे “find का सरल, तेज़ और user-friendly विकल्प” कहकर promote किया जा रहा है, तो नए users के surprise को कम करने के लिए original defaults का सम्मान करना चाहिए। aliases तो हैं ही, इसलिए
~/.${SHELL##*/}rcमेंalias fd='fd --ignore'रखना,alias fd='fd --no-ignore'से बेहतर लगता हैtip के तौर पर, अगर alias लागू न हुआ version इस्तेमाल करना हो तो
\commandइस्तेमाल करें। उदाहरण के लिए मैंalias grep='grep --color=always --no-messages --binary-files=without-matchइस्तेमाल करता हूं, लेकिन color option character representation बदल देता है, जिससेcurlमें pipe करने पर error आ सकता है। हर pipe में ऐसा नहीं होता, लेकिन पहली बार सामना होने पर काफी हक्का-बक्का कर देता है।echo "Hello world" | \grep --color=always "Hello" | hexdumpके बाद!!:s^always^neverसे जांच सकते हैं[0] https://github.com/sharkdp/fd/issues/612
https://github.com/ibraheemdev/modern-unix
zellij,screenसे बेहतर नहीं लगा। tabs/screens की numbering ठीक से नहीं होती, इसलिए सीधे switch करने के लिए खुद गिनना पड़ता है; यह स्वीकार करना मुश्किल हैGNU ls maintained है।
ls.cfile को प्रभावित करने वाले commits 2024-06-24 और 2024-06-27 को भी हुए थे, एक महीने से भी कम पहलेGNU Coreutils mailing list भी काफी सक्रिय है। लगता है यह project “maintained” का मतलब “actively developed” के रूप में इस्तेमाल कर रहा है
ezaने fork किया था।exaलगभग 1 साल तक maintained नहीं था, जब तक repository write access रखने वाले अकेले व्यक्ति ने इसे आधिकारिक रूप से deprecated mark नहीं कियाअब fork हुए भी काफी समय हो गया है, इसलिए हर कोई
exaको नहीं जानता, और इस wording का intent भी बहुत कम स्पष्ट रह गया है। इसी तरह की प्रतिक्रिया दिख रही है, इसलिए लगता है copy update करने का समय आ गया हैlsmaintained नहीं है, बल्कि यह है कि यह अब unmaintainedlsreplacementexaके fork के रूप में maintained replacement हैfish shell पर स्विच करने के बाद
lsका उपयोग 100% घट गया। इसका built-in Alt + l command directory contents दिखाता है, जो बहुत उपयोगी है, और shell history भी ज़्यादा साफ़ हो गईlsजैसे commands कोHISTIGNOREenvironment variable में जोड़ने से history को ज़्यादा साफ़ रखा जा सकता है: https://superuser.com/questions/232885/can-you-share-wisdom-...lsका अधिकतर उपयोग हटाने वाली चीज़ वह setting थी जो directory बदलते समय अपने-आपlsचलाती थीfunction ls_on_cd --on-variable PWDlsend__bash_ctrl_n()जैसे functions से बाँधकर रखा है, और dotfiles के कई tools को ये functions overwrite करने देता हूँ। उदाहरण के लिए, अगर Git installed है तो__bash_ctrl_e()कोgit statusऔरgit logचलाने के लिए set करता हूँlsकोezaका alias बनाया हुआ है, इसलिए लगता है यह featureezaचला रहा है। अंत में ऐसा ही लगता है कि बसlsचल रहा हैlsका अधिकतर executioncdके तुरंत बाद होता है, मैंने इसे startup file में जोड़ दिया। अब लगभग हरcdअपने-आपlsचलाता हैBash में
cd()function सेbuiltin cd "$@" && ls -lcall करता हूँ, और fish मेंbuiltin cd $argvके बाद, error न हो और home में जाना न हो तोdirचलाने देता हूँfile types या attributes अलग दिखाने के लिए रंग थोपने वाले terminal tools कुल मिलाकर असुविधाजनक लगते हैं। distributions का
lsभी अक्सर इसी तरह configured होता है, लेकिन मैं वह setting हटाकर defaults इस्तेमाल करता हूँमैं आँखों के लिए आरामदायक terminal background इस्तेमाल करता हूँ, लेकिन ऐसे color schemes हमेशा background से टकराते हैं या उनमें पढ़ने में मुश्किल रंग होते हैं।
lsया उसके alternatives के output में colors की ज़रूरत नहीं है, औरls -AFCजितना देता है, वह पर्याप्त है[0] https://github.com/chriskempson/base16
[1] https://tinted-theming.github.io/base16-gallery/
फिर भी कोई solution होना चाहिए, और
$NO_COLORमें कोई value set कर देने से काम हो जाता है। https://no-color.orgजो tools इस environment variable को check और respect नहीं करते, उनके लिए bug report डालना पूरी तरह उचित है
vivid[1] का इस्तेमाल करके terminal background से मेल खाने वाली theme चुनें, और generated LS_COLORS variable को shell में load कर दें[1]: https://github.com/sharkdp/vivid/
README में
ezaकोexaका fork नहीं बताया गया है, यह अजीब हैसोच रहा हूँ कि GNU utilities के इतने सारे नए versions MIT license के तहत क्यों बनाए जा रहे हैं। काफी ज़्यादा लगते हैं
lsinvent नहीं किया था।lsसमेत GNU coreutils भी मूल रूप से proprietary AT&T utilities या BSD-licensed utilities के नए versions ही थेlsalternative को Kerberos और SSH की क्या ज़रूरत है?ldd /usr/bin/ezaदेखने पर यहlibgit2,libgssapi_krb5,libmbedtls,libssh2,libkrb5,libcrypto,libzstdवगैरह काफी सारी libraries से linked हैlsके लिए जितनी ज़रूरत होनी चाहिए, उसके मुकाबले dependencies बहुत ज़्यादा हैंQWERTY keyboard पर
ezaतीन अक्षरों का काफी खराब combination है।lsका एक फायदा यह है कि यह बहुत तेज़ी से type किया जा सकने वाला key combo हैalias बनाया जा सकता है, लेकिन compatibility जैसी वजहों से यह थोड़ा अजीब लगता है
eza, और उससे पहलेexaकोls,ll,lllके alias के रूप में use कर रहा हूँ, लेकिन कभी compatibility issue नहीं आयाslभी installed है ताकि गलत type न करूँ, इसके लिए खुद को train कर सकूँezaसुधार जैसा लगता है। Dvorak मेंls, QWERTY के हिसाब सेp-है, यानी दोनों right-hand pinky keys हैंवैसे भी
lsकौन इस्तेमाल करता है? बस tab autocomplete करते रहो जब तक ज़रूरी file न मिल जाएमज़ाक अपनी जगह, लेकिन यह दावा क्यों किया जा रहा है कि
lsअब maintain नहीं होता, यह जानने की उत्सुकता हैlsनहीं, बल्कि अब maintain नहीं होने वाले exa[0] की बात कर रहे हैं[0]https://github.com/ogham/exa
lsshell या coreutils के हिस्से के रूप में maintain होता हैबस
eza,exaका variant है, और मेरी जानकारी मेंexaअब maintain नहीं होता